Pushing a navigation controller is not supported- performing segues
I've tried this and have no problems, its all done in IB with no additional code required ...
- Start a new project, "Single View Application" using story boards
- Select storyboard and delete the views its produced.
- Drag on a new Navigation Controller (it will bring a table view with it)
- Delete the table and the table view controller, so you are just left with the Navigation Controller
- Drag on a normal view controller
- Right Click and drag from the Navigation controller to the new View and choose "Relationship - Root View Controller"
- Drag a "Bar Button Item" on to the Navbar which should be visible on the top of your ViewController, you can rename this Forward if you wish.
- Now drag on another view controller which is the one your "Forward" button will push in to view.
- Right Click and drag from the bar button to the 2nd View Controller, and choose "Push"
Run the project and you will get a Single view with a Navbar and your button, clicking your button will Push the other view and give you a Back Button to return to the first View Controller. I'll try and post a picture of my storyboard if it helps.
Plasma
Pushing a navigation controller is not supported error message
Your UINavigationController
is at the wrong place. It should be before the UITableViewController
.
You can select the UITableViewController
from story board then from menu: Editor > Embed In > Navigation Controller.
You can get more info about the navigation stack from the reference guide.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html
How to Push a Navigation Controller after instantiate
Set your tableVC as root view controller of navigation controller :
let appdelegate = UIApplication.sharedApplication().delegate as! AppDelegate
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
var tableViewController = mainStoryboard.instantiateViewControllerWithIdentifier("TableViewController") as! HomeViewController
let navigationVC = UINavigationController(rootViewController: tableViewController)
appdelegate.window!.rootViewController = navigationVC
Now in TableViewController ,to hide navigation bar
self.navigationController?.setNavigationBarHidden(true, animated: false)
Then you can push another view controller like you mentioned
let newViewController = storyboard!.instantiateViewController(withIdentifier: "player") as! UINavigationController
self.navigationController?.pushViewController(newViewController, animated: true)
Related Topics
Have a Variable with Multiple Types in Swift
How to Convert Bytes to a Float Value in Swift
Programmatically Go Back to Previous Viewcontroller in Swift
Multiline Label in Uistackview
Get the Frame of Uibarbuttonitem in Swift
Disable Bounce Effect in Uipageviewcontroller
Xcode 4.2: How to Import .H File from Subproject
Swiftui: Deleting Last Row in Foreach
How to Observe Changes in Userdefaults
How to Convert Date Like \/Date(1440156888750-0700)\/ to Something That Swift Can Handle
Xcode 8.1 Push Notifications in Swift 2.3 with Firebase Integration Not Getting
iOS 8 Uiactivityviewcontroller and Uialertcontroller Button Text Color Uses Window's Tintcolor
Tableview Cell How Do We Resize Cell in Swift Along with Image and Label
As3 for iOS:How to Serialize an Array and Then Save It
iOS 8 Keyboard Hides My Textview
How to Know Users Click Fast Forward and Fast Rewind Buttons on the Playback Controls in Iphone