Swift - PageViewController go to page
1 answer
you can create a new class View Controller and change the current view to a new view:
///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)
}
0
source to share