1

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.

Renan Geraldo
  • 605
  • 1
  • 6
  • 17
  • Check this answer http://stackoverflow.com/questions/32822794/pageviewcontroller-current-page-index-in-swift – AMAN77 Aug 16 '16 at 14:09
  • Sorry, but I didn't get. Where should I put this method? In my PageViewController class or in my ViewController? – Renan Geraldo Aug 16 '16 at 15:03

0 Answers0