导入框架 #import "PopoverAnimator.h"
//点击事件
-(void)clickBtn{
//1.创建你需要modal出来的控制器
JJTestViewController *popover = [[JJTestViewController alloc]init];
//2. 设置modal样式--因为不设置的话会造成popoverVc弹出的时候,打底的首页和tabBarVc全部被移除掉了,而我的popoverVc不是遮住整个屏幕的,所以不能让底部的控制器移除掉了
popover.modalPresentationStyle = UIModalPresentationCustom; //设置成这个就不会移除了
//3.设置转场代理
self.popoverAnimator = [[PopoverAnimator alloc]init];
// 设置动画执行时间
self.popoverAnimator.timeAnimator = 0.8;
// 设置转场视图的锚点
self.popoverAnimator.popAnchorPoint = CGPointMake(0.5, 0);
// 设置转场协议
popover.transitioningDelegate = self.popoverAnimator;
//4.弹出控制器
[self presentViewController:popover animated:YES completion:nil];
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
JJPopAnimation is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "JJPopAnimation"
1990jiang, 562752212@qq.com
JJPopAnimation is available under the MIT license. See the LICENSE file for more info.