I have two View controllers. I want to click in a button in the FirstViewController and move to the SecondViewController through a PageViewController. I Have the following method in the FirstVC:
@IBAction func moveToOtherPage(sender: AnyObject) {
self.nickname = self.nicknameTextField.text!
self.delegatePages?.movingPage()
}
The implementation of this delegate is in the PageViewController:
func movingPage() {
setViewControllers([self.orderedViewControllers.last!], direction: .Forward, animated: true, completion: nil)
}
The problem is: I click in the button and it passes to the method implemented in the PagesViewController, but nothing happens. If I put "setViewController" in the "viewDidAppear", it works, but inside movingPage, nothing happens.