10
votes

I am following a simple swift tutorial that shows how to add a navigation controller to a viewcontroller in storyboards in xcode. This is done using Editor > Embed in > Navigation Controller

enter image description here

The problem is, once the navigation controller is embedded, it cannot be removed. The 'unembed' option is always greyed out. Removing the controller view from the storyboard results in an error. Even if the arrow indicating the first view is pointing to a simple empty view in exactly the same way as when you're starting a new project.

I would expect that there is still some code from the Navigation Controller lingering around somewhere, but how to pinpoint it?

3
remove link of navigation controller and make root view controller to your view controller.. than it works.Max
But how do I do that in the storyboard view? I can't find any code references anywhere. If I just move the 'arrow' in storyboard view I get this error: Unknown class ViewController in Interface Builder fileKokodoko
see my answer how I do that.Max

3 Answers

10
votes

I follow this step.

1) select navigation controller and delete connection.

select navigation controller

2) make root view to your view controller

make root view

root view

3
votes

No...there is no source code, don't worry.

If your changes are hot then just Control-Z if not select navigation controller and press delete button.

0
votes

"unembed" function is for unembedding the "stack" in stackView and not for "navigation controller" nor "tab bar controller"