Taking control of Storyboard

  • Published on
    22-Jan-2018

  • View
    103

  • Download
    0

Embed Size (px)

Transcript

  1. 1. Taking Control of Storyboard
  2. 2. Pitiphong Phongpattranont iOS Developer @ Throughwave @pitiphong_p
  3. 3. Benets
  4. 4. Reduces a huge amount of codes
  5. 5. Decoupling your view/view controller from each other
  6. 6. Visualizing your views appearance
  7. 7. And also every scenes and transition at a glance(?)
  8. 8. Responsive UI Development
  9. 9. Designer
  10. 10. Core Concept
  11. 11. Main.storyboard Navigation Controller Navigation Controller TableView Controller View Controller root shows
  12. 12. Main.storyboard Navigation Controller Navigation Controller TableView Controller View Controller root shows Scenes
  13. 13. Main.storyboard Navigation Controller TableView Controller View Controller root shows Segues
  14. 14. Main.storyboard Navigation Controller TableView Controller View Controller root shows Relationship Segues
  15. 15. Main.storyboard Navigation Controller TableView Controller View Controller root shows Triggered Segues
  16. 16. Terminologies
  17. 17. Document Outline
  18. 18. Canvas
  19. 19. Inspector
  20. 20. Object Library
  21. 21. Scene
  22. 22. Segue
  23. 23. Scene Dock
  24. 24. -[TableViewController shouldPerformSegueWithIdentier:sender:]
  25. 25. Segue
  26. 26. -[TableViewController prepareForSegue:sender:] Segue
  27. 27. Segue
  28. 28. Segue
  29. 29. Segue
  30. 30. Adaptability
  31. 31. Adaptability
  32. 32. Adaptability
  33. 33. Adaptability
  34. 34. IBDesignable/IBInspectable
  35. 35. Adaptability override func viewDidLoad() { super.viewDidLoad() button.cornerRadius = 12 button.borderColor = .blueColor() button.filled = true }
  36. 36. Demo
  37. 37. Unwind Segue
  38. 38. Unwind Segue protocol UserRegistrationControllerDelegate { func userRegistrationControllerWantToChangeUsername(controller: UserRegistrationController) func userRegistrationControllerWantToChangeUserDetail(controller: UserRegistrationController) func userRegistrationControllerDidCancel(controller: UserRegistrationController) func userRegistrationControllerDidFinish(controller: UserRegistrationController, userDetail: UserDetail) }
  39. 39. Unwind Segue func userRegistrationControllerWantToChangeUsername(controller: UserRegistrationController) { navigationController?.popToViewController(self, animated: true) } func userRegistrationControllerWantToChangeUserDetail(controller: UserRegistrationController) { navigationController?.popToViewController(self, animated: true) } func userRegistrationControllerDidCancel(controller: UserRegistrationController) { dismissViewControllerAnimated(true, completion: nil) } func userRegistrationControllerDidFinish(controller: UserRegistrationController) { // User Registration logic goes here dismissViewControllerAnimated(true, completion: nil) }
  40. 40. Unwind Segue @IBAction func performUserRegistration(segue: UIStoryboardSegue) { // User Registration logic goes here } @IBAction func cancelUserRegistration(segue: UIStoryboardSegue) {} @IBAction func unwindToChangeUsername(segue: UIStoryboardSegue) {} @IBAction func unwindToChangeUserDetail(segue: UIStoryboardSegue) {}
  41. 41. Improvements in Xcode 7
  42. 42. Storyboard Reference
  43. 43. UIStoryboard(name: "Secondary")
  44. 44. UIStoryboard(name: Secondary") .instantiateControllerWithIdentier("tabBarController")
  45. 45. Customizing Standard Segue
  46. 46. Segue
  47. 47. Unwind Segues and Custom Containers
  48. 48. Q&A
  49. 49. Thank You