Transcript
Page 1: iOS Design to Code - Code

iOS developerhttp://about.me/gliyao

design > code

Liyao Chen

Page 2: iOS Design to Code - Code

Objectivedo more with less

Page 3: iOS Design to Code - Code

CodeWant vs. need No code is good code Do not start from 0 Keep step small

Page 4: iOS Design to Code - Code

Cocoa Framework BasicCustom class @IBoutlet & @IBAction UISegue Inheritance hierarchy

Page 5: iOS Design to Code - Code

Custom class

Page 6: iOS Design to Code - Code

Custom class

Page 7: iOS Design to Code - Code

IBOutlet & IBAction

Page 8: iOS Design to Code - Code

UISegue

Page 9: iOS Design to Code - Code

Inheritance hierarchy

Page 10: iOS Design to Code - Code

Inheritance hierarchyEnter viewController - viewDidLoad - viewWillAppear - viewWillLayoutSubviews - viewDidLayoutSubviews - viewDidAppear

Leave viewController - viewWillDisappear - viewDidDisappear

Page 11: iOS Design to Code - Code

Rulepair-programming beat the monster

Page 12: iOS Design to Code - Code

Mission 1Setting page with less code

Page 13: iOS Design to Code - Code

Wireframe of setting page

Page 14: iOS Design to Code - Code

Steps

• Embed in UINavigationController (two ways)

• UITableViewController with static cells (basic and customize style).

• Create show segue with control + drag from cell

• Connect views with IBOutlet and change its property value.

• Simple autolayout (pin view in center of viewController)

• Simple class SRAuthor to setup author page

Page 15: iOS Design to Code - Code

Mission 2Article list page with JSON file

Page 16: iOS Design to Code - Code

Wireframe of article list page

Page 17: iOS Design to Code - Code

Steps

• Read JSON file as dictionary (Break point and check out data)

• List article title with dynamic cells in UITableViewController (Delegate pattern, reuse cell with id).

• Configure cell with article JSON data

• Pass params to another viewController with segueId


Top Related