This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface TTBaseAnimator : NSObject | |
@property (nonatomic) NSTimeInterval duration; | |
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning> )transitionContext; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface TTPushController () | |
@property (nonatomic, strong) TTInteractivePinchTransition* transition; | |
@property (nonatomic, strong) UIPinchGestureRecognizer* pinch; | |
@end | |
// ... | |
- (void)viewDidLoad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@protocol TTInteractivePinchTransitionDelegate <NSObject> | |
-(void)delegateShouldPerformSegue:(TTInteractivePinchTransition*)transition | |
pinch:(UIPinchGestureRecognizer*)pinch; | |
@end | |
@interface TTInteractivePinchTransition : UIPercentDrivenInteractiveTransition | |
@property (nonatomic, weak) id<TTInteractivePinchTransitionDelegate> delegate; | |
-(void)handlePinch:(UIPinchGestureRecognizer*)pinch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fromController.view.hidden = YES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[fromController.view removeFromSuperview]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//remove this line | |
//[transitionContext completeTransition:finished]; | |
//use this code instead: | |
//put the original stuff back in place if the user cancelled | |
if(transitionContext.transitionWasCancelled) | |
{ | |
[toController.view removeFromSuperview]; | |
[container addSubview:fromController.view]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - UINavigationControllerDelegate | |
- (id <UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController | |
interactionControllerForAnimationController:(id <UIViewControllerAnimatedTransitioning>) animationController | |
{ | |
if([animationController isKindOfClass:[TTPushAnimator class]]) | |
return _transition; | |
return nil; | |
} |