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!
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
Looking through the snapchat application you probably don't want to do this all in one
UINavigationController
.Here is what you need.
UIViewController
- This will be your main view. In terms of the snapchat application this is where you would take picutre.UINavigationController
- For the friends listUINavigationController
- For the snapchat (the green window)You need to setup two segues, both leading from your main controller. Once you have your segues setup I would suggest writing your own transition. Have a look at
UIViewControllerContextTransitioning
,UIViewControllerTransitioningDelegate
,UIviewControllerAnimatedTransitioning
.I am at work, but when I get home I'll throw an example together. However, the above should get you pointed in the right direction.
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.
See the documentation on view controller containment: https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html