I have a very simple app using a pageviewcontroller. This works fine using the gesture but how can I jump to the next or previous index / page using a button?
Thank you all
Cheers
Chris
I have a very simple app using a pageviewcontroller. This works fine using the gesture but how can I jump to the next or previous index / page using a button?
Thank you all
Cheers
Chris
you can init your new View Controller class and change the current view to new view like that:
///In viewDidLoad
let myFirstButton = UIButton()
myFirstButton.addTarget(self, action: "pressed:", forControlEvents: .TouchUpInside)
self.view.addSubview(myFirstButton)
//////
func pressed(sender:UIButton!) {
let vc = YourNewViewController() //change this to your class name
self.presentViewController(vc, animated: true, completion: nil)
}