-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add target/source ViewController in STPopupControllerTransitioningCon… #98
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
language: objective-c | ||
osx_image: xcode8 | ||
osx_image: xcode9 | ||
script: | ||
- xcodebuild -project STPopup.xcodeproj -scheme STPopup -sdk iphonesimulator |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,12 @@ typedef NS_ENUM(NSUInteger, STPopupControllerTransitioningAction) { | |
*/ | ||
@property (nonatomic, strong, readonly) UIView *containerView; | ||
|
||
/** | ||
Indicating the target/source View Controller. | ||
*/ | ||
@property (nonatomic, strong) UIViewController *targetViewController; | ||
@property (nonatomic, strong) UIViewController *sourceViewController; | ||
|
||
@end | ||
|
||
@protocol STPopupControllerTransitioning <NSObject> | ||
|
@@ -174,10 +180,8 @@ typedef NS_ENUM(NSUInteger, STPopupTransitionStyle) { | |
*/ | ||
- (void)popViewControllerAnimated:(BOOL)animated; | ||
|
||
|
||
/** | ||
Pops all view controllers from the stack until it reaches the root view controller | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert unneeded change if it's possible. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, done |
||
@param animated YES if animated | ||
*/ | ||
- (void)popToRootViewControllerAnimated:(BOOL)animated; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -429,6 +429,7 @@ - (void)updateNavigationBarAniamted:(BOOL)animated | |
UIView *fromTitleView, *toTitleView; | ||
if (lastTitleView == _defaultTitleLabel) { | ||
UILabel *tempLabel = [[UILabel alloc] initWithFrame:_defaultTitleLabel.frame]; | ||
tempLabel.center = _navigationBar.center; | ||
tempLabel.textColor = _defaultTitleLabel.textColor; | ||
tempLabel.font = _defaultTitleLabel.font; | ||
tempLabel.attributedText = [[NSAttributedString alloc] initWithString:_defaultTitleLabel.text ? : @"" | ||
|
@@ -825,6 +826,7 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC | |
UIViewController *topViewController = self.topViewController; | ||
|
||
STPopupControllerTransitioningContext *context = [self convertTransitioningContext:transitionContext]; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert unneeded change if it's possible. |
||
id<STPopupControllerTransitioning> transitioning = nil; | ||
switch (self.transitionStyle) { | ||
case STPopupTransitionStyleSlideVertical: | ||
|
@@ -839,6 +841,9 @@ - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionC | |
} | ||
NSAssert(transitioning, @"transitioning should be provided if it's using STPopupTransitionStyleCustom"); | ||
|
||
context.targetViewController = topViewController; | ||
context.sourceViewController = fromViewController; | ||
|
||
if (context.action == STPopupControllerTransitioningActionPresent) { | ||
[fromViewController beginAppearanceTransition:NO animated:YES]; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert unneeded change if it's possible.