1

I am new to iOS and currently I am working with container view using tutorial https://kodesnippets.wordpress.com/2015/08/11/container-view-in-ios/

And I want to add one functionality i.e. in Second View Controller I want to add a button and then on click of that button I want to open Third View Controller in the same container view that lies under ViewController.swift.

Now, problem is that when I click on Button in Second View Controller then It shows me fatal exception that I have mentioned in question.

Code for Second View Controller on button's Touch Up Inside

  @IBAction func send(_ sender: UIButton) {

    container!.segueIdentifierReceivedFromParent("Third")

}

Please help if anyone knows.

1 Answers1

1

I have pushed a new Storyboard with name Secondary.storyboard, with your requirement added. Give it a try. See the attached image.

https://github.com/iaaqib/ContainerView

enter image description here

Aaqib Hussain
  • 828
  • 2
  • 9
  • 12