Popover with embedded navigation controller doesn’t respect size on back nav

I was struggling with the same issue. None of the above solutions worked for me pretty nicely, that is why I decided to do a little investigation and find out how this works. This is what I discovered: When you set the contentSizeForViewInPopover in your view controller it won’t be changed by the popover itself … Read more

Programmatically navigate to another view controller/scene

I already found the answer Swift 4 let storyBoard : UIStoryboard = UIStoryboard(name: “Main”, bundle:nil) let nextViewController = storyBoard.instantiateViewController(withIdentifier: “nextView”) as! NextViewController self.present(nextViewController, animated:true, completion:nil) Swift 3 let storyBoard : UIStoryboard = UIStoryboard(name: “Main”, bundle:nil) let nextViewController = storyBoard.instantiateViewControllerWithIdentifier(“nextView”) as NextViewController self.presentViewController(nextViewController, animated:true, completion:nil)

Adding a view controller as a subview in another view controller

A couple of observations: When you instantiate the second view controller, you are calling ViewControllerB(). If that view controller programmatically creates its view (which is unusual) that would be fine. But the presence of the IBOutlet suggests that this second view controller’s scene was defined in Interface Builder, but by calling ViewControllerB(), you are not … Read more

iOS Nested View Controllers view inside UIViewController’s view?

No, this is generally good design, it helps keep your view controllers concise. However you should be using the view controller containment pattern, take a look at the following documentation. Implementing a Container View Controller This is incredibly simple to setup using Interface Builder with Storyboards as well, take a look at the Container View … Read more

Leaking views when changing rootViewController inside transitionWithView

I had a similar issue recently. I had to manually remove that UITransitionView from the window to fix the problem, then call dismiss on the previous root view controller to ensure its deallocated. The fix is not really very nice but unless you’ve found a better way since posting the question, its the only thing … Read more

Custom init for UIViewController in Swift with interface setup in storyboard

As it was specified in one of the answers above you can not use both and custom init method and storyboard. But you still can use a static method to instantiate ViewController from a storyboard and perform additional setup on it. It will look like this: class MemeDetailVC : UIViewController { var meme : Meme! … Read more