i have been working on an pageViewController in swift and xcode. I used the default template in xcode and made a pageViewController application. But now i want to place a button on the pageViewController that shows on all pageViewControllers and when tapped that button the pageViewController dismissed and the RootViewController screen is shown back. I have written this line but this does nothing.
self.dismiss(animated: true, completion: nil)
But this is of no help. Can you please tell me how can i achieve this? Thank you.
You should use popToRootViewController() . You could have a nav bar with a button that calls this function so that whatever view you are currently on, it will pop to the rootviewcontroller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.