I am trying to add a child view controller in code, to the current view controller from storyboard by using the next code:
UIStoryboard *storyboard = [UIStor
Solution in Swift (Swift 4 at the time of this writing):
//load the view controller and add as child
storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
loginVC = storyboard.instantiateViewController(withIdentifier: "LOGIN")
addChildViewController(loginVC)
//make sure that the child view controller's view is the right size
loginVC.view.frame = contentView.bounds
contentView.addSubview(loginVC.view)
//you must call this at the end per Apple's documentation
loginVC.didMove(toParentViewController: self)
Notes: