demo 地址https://github.com/liranhao/PhotoViewerTest
图片查看器弹出动画和下滑关闭查看器动画,仅供想学习这类动画的朋友学习
效果
可以使用模态的方式弹出查看器controller,为了使present的VC和当前VC在同一层级
我们设置一下这个参数
TestViewController *test = [[TestViewController alloc] init];
test.modalPresentationStyle = UIModalPresentationOverCurrentContext;//具体意思参考https://blog.csdn.net/tianweitao/article/details/80314598
test.definesPresentationContext = YES;//为了使present的VC和当前VC在同一层级
[self.navigationController presentViewController:test animated:NO completion:^{
[test show:self.smallView];
}];
接下来就进入查看器页面,我们所用的拖动手势不是添加UIPinchGestureRecognizer拖拽手势
我们来使用toch event回调来实现拖拽动画
首先我们在- (void)touchesBegan里面判断是否拖拽的是我们想要拖拽的视图
<