I am new to iOS. And I want to use navigation controller in my application but I have no any idea how to do it. So can any one guide me step by step for creating navigation in my application.
相关问题
- 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
For Swift 3.0, using filter:
So for creating a UINavigationController programatically without using storyboards, go to your app delegate and do the following. Create two properties, window and viewController
where ImageViewController2 is a class name
If you want to create everything programmatically , you have to do it in AppDelegate.
But if you don't want to do it programmatically, then just select the ViewController in Storyboard then select menu options :
Editor->Embed In -> Navigation Controller
In appDelegate.h
and set the delegate
UINavigationControllerDelegate
and synthesise object inappDelegate.m
now,appDelegate.m
you can set navigation controller in
didFinishLaunchingWithOptions
methodIn the above code , your firstViewController is set to
UINavigationController
andUINavigationController
added toUIWindow
likeself.window.rootViewController = self.navController
Hope this may help you
You can creat UINavigationController in Appdelegate and set your first viewcontroller on it.