iOS在Snapchat之类的滑动手势上推送UIViewController [英] iOS Push UIViewController on slide gesture like Snapchat

查看:125
本文介绍了iOS在Snapchat之类的滑动手势上推送UIViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对iOS推送导航控制器有疑问.我想按滑动手势推动视图控制器.就像在Snapchat应用程序中一样:主视图捕获图像.如果从左向右滑动,则Snapchat消息视图会平滑地滑动(推动)到主窗口.如果从右向左滑动>联系人视图.如何创建这种导航?非常感谢!

I have a question about iOS push navigation controllers. I want to push view controller on slide gesture. Just like as in Snapchat application: main view captures images. If you slide from left to right, snapchat messages view smoothly slides (pushes) to main window. If you slide from right to left > contacts view. How to create this kind of navigation? Thanks a lot!

推荐答案

我相信Snapchat的实现方式是通过UIViewController包含.本质上,主视图控制器包含一个滚动视图(启用了分页),其中包含3个子视图控制器(快照,相机和联系人).滑动时,他们不使用导航控制器来呈现和弹出视图控制器.

I believe the way that Snapchat does it is through UIViewController containment. Essentially, the main view controller contains a scroll view (paging enabled) with 3 child view controllers (snaps, camera, and contacts). They don't use a navigation controller to present and pop view controllers as you swipe.

请参阅有关视图控制器包含的文档: https://developer. apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html

See the documentation on view controller containment: https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html

这篇关于iOS在Snapchat之类的滑动手势上推送UIViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆