Top Banner
Taking Control of Storyboard
83

Taking control of Storyboard

Jan 22, 2018

Download

Software

pitiphong_p
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Taking control of Storyboard

Taking Control of Storyboard

Page 2: Taking control of Storyboard

Pitiphong PhongpattranontiOS Developer @ Throughwave@pitiphong_p

Page 3: Taking control of Storyboard

Benefits

Page 4: Taking control of Storyboard

Reduces a huge amount of codes

Page 5: Taking control of Storyboard

Decoupling your view/view controller from each other

Page 6: Taking control of Storyboard

Visualizing your views appearance

Page 7: Taking control of Storyboard

And also every scenes and transition at a glance(?)

Page 8: Taking control of Storyboard

Responsive UI Development

Page 9: Taking control of Storyboard

“มีแบบนี้ไหม ของเว็บหนะ”

–Designer ท่านหนึ่ง

Page 10: Taking control of Storyboard

Core Concept

Page 11: Taking control of Storyboard
Page 12: Taking control of Storyboard
Page 13: Taking control of Storyboard
Page 14: Taking control of Storyboard
Page 15: Taking control of Storyboard

Main.storyboard

Navigation ControllerNavigation Controller

TableView Controller

View Controller

root shows

Page 16: Taking control of Storyboard

Main.storyboard

Navigation ControllerNavigation Controller

TableView Controller

View Controller

root shows

Scenes

Page 17: Taking control of Storyboard

Main.storyboard

Navigation Controller

TableView Controller

View Controller

root shows

Segues

Page 18: Taking control of Storyboard

Main.storyboard

Navigation Controller

TableView Controller

View Controller

root shows

Relationship Segues

Page 19: Taking control of Storyboard

Main.storyboard

Navigation Controller

TableView Controller

View Controller

root shows

Triggered Segues

Page 20: Taking control of Storyboard

Terminologies

Page 21: Taking control of Storyboard
Page 22: Taking control of Storyboard

Document Outline

Page 23: Taking control of Storyboard

Canvas

Page 24: Taking control of Storyboard

Inspector

Page 25: Taking control of Storyboard

Object Library

Page 26: Taking control of Storyboard
Page 27: Taking control of Storyboard

Scene

Page 28: Taking control of Storyboard

Segue

Page 29: Taking control of Storyboard

Scene Dock

Page 30: Taking control of Storyboard
Page 31: Taking control of Storyboard
Page 32: Taking control of Storyboard

-[TableViewController shouldPerformSegueWithIdentifier:sender:]

Page 33: Taking control of Storyboard

Segue

Page 34: Taking control of Storyboard

-[TableViewController prepareForSegue:sender:]

Segue

Page 35: Taking control of Storyboard

Segue

Page 36: Taking control of Storyboard

Segue

Page 37: Taking control of Storyboard

Segue

Page 38: Taking control of Storyboard
Page 39: Taking control of Storyboard

Adaptability

Page 40: Taking control of Storyboard

Adaptability

Page 41: Taking control of Storyboard

Adaptability

Page 42: Taking control of Storyboard

Adaptability

Page 43: Taking control of Storyboard
Page 44: Taking control of Storyboard
Page 45: Taking control of Storyboard
Page 46: Taking control of Storyboard
Page 47: Taking control of Storyboard
Page 48: Taking control of Storyboard
Page 49: Taking control of Storyboard
Page 50: Taking control of Storyboard

IBDesignable/IBInspectable

Page 51: Taking control of Storyboard

Adaptability

override func viewDidLoad() { super.viewDidLoad() button.cornerRadius = 12 button.borderColor = .blueColor() button.filled = true }

Page 52: Taking control of Storyboard

Demo

Page 53: Taking control of Storyboard

Unwind Segue

Page 54: Taking control of Storyboard
Page 55: Taking control of Storyboard
Page 56: Taking control of Storyboard
Page 57: Taking control of Storyboard
Page 58: Taking control of Storyboard
Page 59: Taking control of Storyboard
Page 60: Taking control of Storyboard
Page 61: Taking control of Storyboard

Unwind Segue

protocol UserRegistrationControllerDelegate { func userRegistrationControllerWantToChangeUsername(controller: UserRegistrationController) func userRegistrationControllerWantToChangeUserDetail(controller: UserRegistrationController) func userRegistrationControllerDidCancel(controller: UserRegistrationController) func userRegistrationControllerDidFinish(controller: UserRegistrationController, userDetail: UserDetail) }

Page 62: Taking control of Storyboard

Unwind Seguefunc 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) }

Page 63: Taking control of Storyboard

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) {}

Page 64: Taking control of Storyboard
Page 65: Taking control of Storyboard
Page 66: Taking control of Storyboard

Improvements in Xcode 7

Page 67: Taking control of Storyboard

Storyboard Reference

Page 68: Taking control of Storyboard
Page 69: Taking control of Storyboard
Page 70: Taking control of Storyboard
Page 71: Taking control of Storyboard

UIStoryboard(name: "Secondary")

Page 72: Taking control of Storyboard

UIStoryboard(name: “Secondary") .instantiateControllerWithIdentifier("tabBarController")

Page 73: Taking control of Storyboard
Page 74: Taking control of Storyboard
Page 75: Taking control of Storyboard
Page 76: Taking control of Storyboard
Page 77: Taking control of Storyboard

Customizing Standard Segue

Page 78: Taking control of Storyboard

Segue

Page 79: Taking control of Storyboard
Page 80: Taking control of Storyboard

Unwind Segues and Custom Containers

Page 81: Taking control of Storyboard
Page 82: Taking control of Storyboard

Q&A

Page 83: Taking control of Storyboard

Thank You