安装了MMTransitionAnimator pod文件。查看同时向上和向下滑动其工作正常但在点击按钮时不解除视图。请参阅此链接github.com/mojun/MMTransitionAnimator.How在点击按钮动作时解除视图。任何人都可以帮助我。
答案 0 :(得分:1)
提交时:
self.modalVC.delegate = self;
在呈现的ModalViewController中创建一个委托:
@protocol ModalViewControllerDelegate <NSObject>
@optional
- (void)closeButtonPressed;
@end
@interface ModalViewController : UIViewController
@property (nonatomic, weak) id <ModalViewControllerDelegate> delegate;
@end
@implementation ModalViewController
- (void)btnCloseTapped {
[self.delegate closeButtonPressed];
}
@end
然后在您的呈现视图控制器中实现该委托,如:
- (void)closeButtonPressed {
//Needs to play more..
_animator = [[MMTransitionAnimator alloc] initWithOperationType:MMTransitionAnimatorOperationNone fromVC:_modalVC toVC:self];
_animator.usingSpringWithDamping = 0.8f;
_animator.interactiveType = MMTransitionAnimatorOperationDismiss;
_containerView.alpha = 1;
_handleBarView.y = self.view.height - _handleBarView.height;;
[self.modalVC dismissViewControllerAnimated:YES completion:nil];
}