Guest User

Untitled

a guest
Apr 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. func forwardPage() {
  2. print("Start")
  3. currentPage += 1
  4. print(vcs[currentPage])
  5. self.setViewControllers([vcs[currentPage]], direction: .forward, animated: true) { (true) in
  6. print("Done")
  7. }
  8. }
  9.  
  10. protocol WalkthroughViewControllerDelegate {
  11. func forwardPage()
  12. func currentIndex() -> Int
  13. }
  14.  
  15. @IBAction func nextButtonTapped(_ sender: Any) {
  16. if let index = delegate?.currentIndex() {
  17. print("Here... (index)")
  18. switch index {
  19. case 0...1:
  20. print("Forwarding...")
  21. delegate?.forwardPage()
  22. case 2:
  23. dismiss(animated: true, completion: nil)
  24. default: break
  25. }
  26. }
  27.  
  28. updateUI()
  29. }
Add Comment
Please, Sign In to add comment