I made an iOS app with Xcode and Swift.
One ViewController contains two ContainerViews. The user can switch between them with SegmentedControl.
But, how can I switch to the other ContainerView without the SegmentedControl, e.g. with a button?
Actually I have this code:
let vc : AnyObject! = self.storyboard!.instantiateViewControllerWithIdentifier("login")
self.showViewController(vc as! UIViewController, sender: vc)
You must have to set the
viewControllers too to call them separately using
assign same class to both parentViewcontroller and containerView using identity inspector see image.
connect IBOutlet as well like parentViewController see image
Now can access from class using