Cocoa Touch Best Practices

Size: px
Start display at page:

Download "Cocoa Touch Best Practices"

Transcription

1 App Frameworks #WWDC15 Cocoa Touch Best Practices Session 231 Luke Hiesterman UIKit Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

2 Agenda

3 Agenda App Lifecycle

4 Agenda App Lifecycle Views and View Controllers

5 Agenda App Lifecycle Views and View Controllers Auto Layout

6 Agenda App Lifecycle Views and View Controllers Auto Layout Table and Collection Views

7 Goals

8 Goals Performance

9 Goals Performance User Experience

10 Goals Performance User Experience Future Proofing

11 App Lifecycle Best practices begin here

12 Launch Quickly

13 Launch Quickly Return quickly from applicationdidfinishlaunching

14 Launch Quickly Return quickly from applicationdidfinishlaunching Defer long running work

15 Launch Quickly Return quickly from applicationdidfinishlaunching Defer long running work App killed if too much time passes

16 Beyond App Launch Being responsive to every input

17 Beyond App Launch Being responsive to every input Not just about asynchrony

18 Beyond App Launch Being responsive to every input Not just about asynchrony Move long running work to background queues

19 Beyond App Launch Being responsive to every input func application(application: UIApplication, didfinishlaunchingwithoptions launchoptions: [NSObject: AnyObject]?) -> Bool { globaldatastructure = MyCoolDataStructure() globaldatastructure.fetchdatafromdatabase() } return true

20 Beyond App Launch Being responsive to every input func application(application: UIApplication, didfinishlaunchingwithoptions launchoptions: [NSObject: AnyObject]?) -> Bool { globaldatastructure = MyCoolDataStructure() globaldatastructure.fetchdatafromdatabase() } return true

21 Beyond App Launch Being responsive to every input func application(application: UIApplication, didfinishlaunchingwithoptions launchoptions: [NSObject: AnyObject]?) -> Bool { globaldatastructure = MyCoolDataStructure() dispatch_async(dispatch_get_main_queue()) { // defer work until later globaldatastructure.fetchdatafromdatabase() } } return true

22 Beyond App Launch Being responsive to every input func application(application: UIApplication, didfinishlaunchingwithoptions launchoptions: [NSObject: AnyObject]?) -> Bool { globaldatastructure = MyCoolDataStructure() let globalqueue = dispatch_get_global_queue(dispatch_queue_priority_default, 0) dispatch_async(globalqueue) { // defer work until later globaldatastructure.fetchdatafromdatabase() } } return true

23 Launch Quickly Again

24 Launch Quickly Again System Memory

25 Launch Quickly Again Kernel + OS Processes System Memory

26 Launch Quickly Again Foreground App Kernel + OS Processes System Memory

27 Launch Quickly Again Background App Background App Background App Background App Foreground App Kernel + OS Processes System Memory

28 Launch Quickly Again Background App Background App Background App Background App First to Die Foreground App Kernel + OS Processes System Memory

29 Launch Quickly Again Background App Background App Background App Foreground App Background App First to Die Foreground App Kernel + OS Processes System Memory

30 Launch Quickly Again Background App Background App Background App Foreground App Foreground App Kernel + OS Processes System Memory

31 Leverage Frameworks

32 Leverage Frameworks Reduce maintenance burden

33 Leverage Frameworks Reduce maintenance burden Get improvements for free

34 Leverage Frameworks Reduce maintenance burden Get improvements for free Focus time on what makes your app special

35 Leverage Frameworks Properly manage version change

36 Leverage Frameworks Properly manage version change Target two most recent major releases

37 Leverage Frameworks Properly manage version change Target two most recent major releases Include version fallbacks

38 Leverage Frameworks Properly manage version change Target two most recent major releases Include version fallbacks e.g., if systemversion == 9.0

39 Leverage Frameworks Properly manage version change Target two most recent major releases Include version fallbacks e.g., if systemversion == 9.0 e.g., if systemversion >= 9.0

40 Leverage Frameworks Properly manage version change Target two most recent major releases Include version fallbacks e.g., if systemversion == 9.0 e.g., if systemversion >= 9.0 e.g., if #available (ios 9.0, *) {}

41 Leverage Frameworks Properly manage version change Target two most recent major releases Include version fallbacks e.g., if systemversion == 9.0 e.g., if systemversion >= 9.0 e.g., if #available (ios 9.0, *) {} Have an else clause

42 Views and View Controllers A best practice for every screen

43 Layout on Modern Devices

44 Layout on Modern Devices

45 Layout to Proportions

46 Layout to Proportions Avoid hard-coded layout values

47 Layout to Proportions Avoid hard-coded layout values A UILabel to contain some content

48 Layout to Proportions 30 Pts 260 Pts Avoid hard-coded layout values A UILabel to contain some content

49 Layout to Proportions 30 Pts 260 Pts Avoid hard-coded layout values Either or both dimensions may scale A UILabel to contain some content

50 Layout to Proportions Avoid hard-coded layout values Either or both dimensions may scale A UILabel to contain some content Centered

51 Size Classes

52 Size Classes Some size thresholds trigger major change

53 Size Classes Some size thresholds trigger major change iphone 4S

54 Size Classes Some size thresholds trigger major change iphone 5

55 Size Classes Some size thresholds trigger major change iphone 6

56 Size Classes Some size thresholds trigger major change iphone 6 Plus

57 Size Classes Some size thresholds trigger major change ipad

58 Size Classes Some size thresholds trigger major change iphone 6 Plus

59 Size Classes Some size thresholds trigger major change Packaged in UITraitCollection iphone 6 Plus

60 Properties, Not Tags!

61 Properties, Not Tags! Avoid settag: and viewwithtag:

62 Properties, Not Tags! Avoid settag: and viewwithtag: Possible collisions with other code

63 Properties, Not Tags! Avoid settag: and viewwithtag: Possible collisions with other code No compiler warnings

64 Properties, Not Tags! Avoid settag: and viewwithtag: Possible collisions with other code No compiler warnings No runtime errors

65 Properties, Not Tags! Avoid settag: and viewwithtag: Possible collisions with other code No compiler warnings No runtime errors Instance variables and properties provide better alternative

66 Properties, Not Tags! let ImageViewTag = 1000 class ViewController: UIViewController { override func viewdidload() { super.viewdidload() } } let imageview = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50)) imageview.tag = ImageViewTag view.addsubview(imageview)

67 Properties, Not Tags! let ImageViewTag = 1000 class ViewController: UIViewController { override func viewdidload() { super.viewdidload() } } let imageview = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50)) imageview.tag = ImageViewTag view.addsubview(imageview)

68 Properties, Not Tags! class ViewController: UIViewController { var imageview : UIImageView override func viewdidload() { super.viewdidload() } } imageview = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50)) view.addsubview(imageview)

69 Make Timing Deterministic

70 Make Timing Deterministic Leverage UIViewControllerTransitionCoordinator

71 Make Timing Deterministic Leverage UIViewControllerTransitionCoordinator Animate alongside a transition

72 Make Timing Deterministic Leverage UIViewControllerTransitionCoordinator Animate alongside a transition Get accurate completion timing

73 Make Timing Deterministic Leverage UIViewControllerTransitionCoordinator Animate alongside a transition Get accurate completion timing Support interactive and cancelable animations

74 Auto Layout Layout ninjas unite

75 Modify Constraints Efficiently

76 Modify Constraints Efficiently Identify constraints that get changed, added, or removed

77 Modify Constraints Efficiently Identify constraints that get changed, added, or removed Unchanged constraints are optimized

78 Modify Constraints Efficiently Identify constraints that get changed, added, or removed Unchanged constraints are optimized Avoid removing all constraints

79 Modify Constraints Efficiently Identify constraints that get changed, added, or removed Unchanged constraints are optimized Avoid removing all constraints Use explicit constraint references

80 Modify Constraints Efficiently override func updateviewconstraints() { super.updateviewconstraints() } view.removeconstraints(view.constraints()) view.addconstraints(self.generateconstraints())

81 Modify Constraints Efficiently override func updateviewconstraints() { super.updateviewconstraints() } view.removeconstraints(view.constraints()) view.addconstraints(self.generateconstraints())

82 Modify Constraints Efficiently override func updateviewconstraints() { super.updateviewconstraints() } view.removeconstraint(imageviewhorizontalconstraint) imageviewhorizontalconstraint = self.generateimageviewhorizontalconstraint() view.addconstraint(imageviewhorizontalconstraint)

83 Modify Constraints Efficiently override func updateviewconstraints() { super.updateviewconstraints() } view.removeconstraint(imageviewhorizontalconstraint) imageviewhorizontalconstraint = self.generateimageviewhorizontalconstraint() view.addconstraint(imageviewhorizontalconstraint)

84 Modify Constraints Efficiently override func updateviewconstraints() { super.updateviewconstraints() } view.removeconstraint(imageviewhorizontalconstraint) imageviewhorizontalconstraint = self.generateimageviewhorizontalconstraint() view.addconstraint(imageviewhorizontalconstraint)

85 Modify Constraints Efficiently override func updateviewconstraints() { super.updateviewconstraints() } view.removeconstraint(imageviewhorizontalconstraint) imageviewhorizontalconstraint = self.generateimageviewhorizontalconstraint() view.addconstraint(imageviewhorizontalconstraint)

86 Constraint Specificity De-duplicating constraints

87 Constraint Specificity De-duplicating constraints Duplicates are implied by existing constraints

88 Constraint Specificity De-duplicating constraints Duplicates are implied by existing constraints Duplicates cause excess work in layout engine

89 Constraint Specificity De-duplicating constraints Top Bottom

90 Constraint Specificity De-duplicating constraints Top Bottom "V:[Top]-[Bottom]- " + NSLayoutFormatAlignAllLeft

91 Constraint Specificity De-duplicating constraints Top Bottom "V:[Top]-[Bottom]- " + NSLayoutFormatAlignAllLeft "H: -[Top]- "

92 Constraint Specificity De-duplicating constraints Top Bottom "V:[Top]-[Bottom]- " + NSLayoutFormatAlignAllLeft "H: -[Top]- " "H: -[Bottom]- "

93 Constraint Specificity Create flexible constraints

94 Constraint Specificity Create flexible constraints Avoid hard-coded values

95 Constraint Specificity Create flexible constraints Avoid hard-coded values A UILabel to contain some content

96 Constraint Specificity Create flexible constraints Avoid hard-coded values 30 Pts 260 Pts A UILabel to contain some content

97 Constraint Specificity Create flexible constraints Avoid hard-coded values 30 Pts 260 Pts A UILabel to contain some content V:-30-[Label(==260)]

98 Constraint Specificity Create flexible constraints Avoid hard-coded values 30 Pts 260 Pts Describe constraints using bounds A UILabel to contain some content

99 Constraint Specificity Create flexible constraints Avoid hard-coded values 30 Pts 260 Pts Describe constraints using bounds A UILabel to contain some content V:[Label(<=superview - 60)] NSLayoutFormatAlignAllCenterX

100 Constraint Specificity Fully specify constraints

101 Constraint Specificity Fully specify constraints Underspecification generates ambiguity

102 Constraint Specificity Fully specify constraints Underspecification generates ambiguity

103 Constraint Specificity Fully specify constraints Underspecification generates ambiguity Ambiguity is undefined

104 Constraint Specificity Fully specify constraints Underspecification generates ambiguity Ambiguity is undefined

105 Constraint Specificity Testing and debugging

106 Constraint Specificity Testing and debugging -[UIView hasambiguouslayout]

107 Constraint Specificity Testing and debugging -[UIView hasambiguouslayout] When called on UIWindow, returns result for entire view tree

108 Constraint Specificity Testing and debugging -[UIView hasambiguouslayout] When called on UIWindow, returns result for entire view tree -[UIView _autolayouttrace]

109 Constraint Specificity Testing and debugging -[UIView hasambiguouslayout] When called on UIWindow, returns result for entire view tree -[UIView _autolayouttrace] Both can be used for unit testing

110 Table and Collection Views Impress your friends

111 Self-Sizing Cells

112 Self-Sizing Cells

113 Self-Sizing Cells

114 Self-Sizing Cells

115 Self-Sizing Cells Fully specify constraints

116 Self-Sizing Cells Fully specify constraints Width = input; height = output

117 Self-Sizing Cells

118 Self-Sizing Cells

119 Self-Sizing Cells

120 Animating Height Changes

121 Animating Height Changes 0

122 Animating Height Changes

123 Animating Height Changes

124 Animating Height Changes

125 Animating Height Changes Steps

126 Animating Height Changes Steps 1. tableview.beginupdates

127 Animating Height Changes Steps 1. tableview.beginupdates 2. Update model

128 Animating Height Changes Steps 1. tableview.beginupdates 2. Update model 3. Update cell contents

129 Animating Height Changes Steps 1. tableview.beginupdates 2. Update model 3. Update cell contents 4. tableview.endupdates

130 Fast Collection View Layout Invalidation

131 Fast Collection View Layout Invalidation

132 Fast Collection View Layout Invalidation

133 Fast Collection View Layout Invalidation

134 Fast Collection View Layout Invalidation Modify only what is needed

135 Fast Collection View Layout Invalidation Modify only what is needed 1. Invalidate on bounds change

136 Fast Collection View Layout Invalidation Modify only what is needed 1. Invalidate on bounds change 2. Build targeted invalidation context

137 Fast Collection View Layout Invalidation Modify only what is needed 1. Invalidate on bounds change 2. Build targeted invalidation context 3. Repeat as necessary

138 Summary

139 Summary Performance

140 Summary Performance User experience

141 Summary Performance User experience Future proofing

142 More Information Documentation What s New in ios Start Developing ios Apps (Swift) App Programming Guide for ios Technical Support Apple Developer Forums Developer Technical Support Curt Rothert App Frameworks Evangelist rothert@apple.com

143

Enhancing your apps for the next dimension of touch

Enhancing your apps for the next dimension of touch App Frameworks #WWDC16 A Peek at 3D Touch Enhancing your apps for the next dimension of touch Session 228 Tyler Fox UIKit Frameworks Engineer Peter Hajas UIKit Frameworks Engineer 2016 Apple Inc. All rights

More information

Monetize and Promote Your App with iad

Monetize and Promote Your App with iad Media #WWDC15 Monetize and Promote Your App with iad From design to launch Session 503 Carol Teng Shashank Phadke 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

App Extension Best Practices

App Extension Best Practices App Frameworks #WWDC15 App Extension Best Practices Session 224 Sophia Teutschler UIKit Engineer Ian Baird CoreOS Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted

More information

Mastering Drag and Drop

Mastering Drag and Drop Session App Frameworks #WWDC17 Mastering Drag and Drop 213 Tom Adriaenssen, UIKit Wenson Hsieh, WebKit Robb Böhnke, UIKit 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted

More information

Implementing UI Designs in Interface Builder

Implementing UI Designs in Interface Builder Developer Tools #WWDC15 Implementing UI Designs in Interface Builder Session 407 Kevin Cathey Interface Builder Engineer Tony Ricciardi Interface Builder Engineer 2015 Apple Inc. All rights reserved. Redistribution

More information

Document Version Date: 1st March, 2015

Document Version Date: 1st March, 2015 7 Minute Fitness: ios(swift) Application Document Version 1.0.1 Date: 1st March, 2015 2 [7 MINUTE FITNESS: APP DOCUMENTATION] Important Notes:... 5 AppDelegate Class Reference... 6 Tasks... 6 Instance

More information

lecture 10 UI/UX and Programmatic Design cs : spring 2018

lecture 10 UI/UX and Programmatic Design cs : spring 2018 lecture 10 UI/UX and Programmatic Design cs198-001 : spring 2018 1 Announcements custom app progress form due before lab (~1 minute) will be released after lecture only 2 labs left (both very important)

More information

ios Accessibility Developing for everyone Session 201 Ian Fisch ios Accessibility

ios Accessibility Developing for everyone Session 201 Ian Fisch ios Accessibility App Frameworks #WWDC15 ios Accessibility Developing for everyone Session 201 Ian Fisch ios Accessibility 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

News- ipad: ios(swift) Application

News- ipad: ios(swift) Application News- ipad: ios(swift) Application Document Version 1.0.1 Date: 9 th Nov, 2014 2 [NEWS- IPAD: APP DOCUMENTATION] Important Notes:... 6 AppDelegate Class Reference... 7 Tasks... 7 Instance Methods... 7

More information

Mysteries of Auto Layout, Part 1

Mysteries of Auto Layout, Part 1 App Frameworks #WWDC15 Mysteries of Auto Layout, Part 1 Session 218 Jason Yao Interface Builder Engineer Kasia Wawer ios Keyboards Engineer 2015 Apple Inc. All rights reserved. Redistribution or public

More information

Leveraging Touch Input on ios

Leveraging Touch Input on ios App Frameworks #WWDC16 Leveraging Touch Input on ios And getting the most out of Apple Pencil Session 220 Dominik Wagner UIKit Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display

More information

Social Pinboard: ios(swift) Application

Social Pinboard: ios(swift) Application Social Pinboard: ios(swift) Application Document Version 1.0.1 Date: 15 th May, 2015 2 [SOCIAL PINBOARD: APP DOCUMENTATION] Important Notes:... 5 AppDelegate Class Reference... 6 Tasks... 6 Instance Methods...

More information

Media and Gaming Accessibility

Media and Gaming Accessibility Session System Frameworks #WWDC17 Media and Gaming Accessibility 217 Greg Hughes, Software Engineering Manager Charlotte Hill, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or public

More information

What s New in tvos #WWDC16. App Frameworks. Session 206. Hans Kim tvos Engineer

What s New in tvos #WWDC16. App Frameworks. Session 206. Hans Kim tvos Engineer App Frameworks #WWDC16 What s New in tvos Session 206 Hans Kim tvos Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Welcome

More information

View Controller Advancements for ios8

View Controller Advancements for ios8 Frameworks #WWDC14 View Controller Advancements for ios8 Session 214 Bruce D. Nilo Manager, UIKit Fundamentals 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

Mastering UIKit on tvos

Mastering UIKit on tvos App Frameworks #WWDC16 Mastering UIKit on tvos Session 210 Justin Voss UIKit Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from

More information

Advanced Notifications

Advanced Notifications System Frameworks #WWDC16 Advanced Notifications Session 708 Michele Campeotto ios Notifications 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

CSE 438: Mobile Application Development Lab 2: Virtual Pet App

CSE 438: Mobile Application Development Lab 2: Virtual Pet App CSE 438: Mobile Application Development Lab 2: Virtual Pet App Overview In this lab, you will create an app to take care of your very own virtual pets! The app will only have one screen and simple logic,

More information

ios Memory Deep Dive #WWDC18 Kyle Howarth, Software Engineer James Snee, Software Engineer Kris Markel, Software Engineer

ios Memory Deep Dive #WWDC18 Kyle Howarth, Software Engineer James Snee, Software Engineer Kris Markel, Software Engineer Session #WWDC18 ios Memory Deep Dive 416 Kyle Howarth, Software Engineer James Snee, Software Engineer Kris Markel, Software Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display

More information

What's New in UIKit Dynamics and Visual Effects Session 229

What's New in UIKit Dynamics and Visual Effects Session 229 App Frameworks #WWDC15 What's New in UIKit Dynamics and Visual Effects Session 229 Michael Turner UIKit Engineer David Duncan UIKit Engineer 2015 Apple Inc. All rights reserved. Redistribution or public

More information

Seamless Linking to Your App

Seamless Linking to Your App App Frameworks #WWDC15 Seamless Linking to Your App Session 509 Conrad Shultz Safari and WebKit Software Engineer Jonathan Grynspan Core Services Software Engineer 2015 Apple Inc. All rights reserved.

More information

Modern User Interaction on ios

Modern User Interaction on ios App Frameworks #WWDC17 Modern User Interaction on ios Mastering the UIKit UIGesture System Session 219 Dominik Wagner, UIKit Engineer Michael Turner, UIKit Engineer Glen Low, UIKit Engineer 2017 Apple

More information

Advanced Scrollviews and Touch Handling Techniques

Advanced Scrollviews and Touch Handling Techniques Frameworks #WWDC14 Advanced Scrollviews and Touch Handling Techniques Session 235 Josh Shaffer ios Apps and Frameworks Engineer Eliza Block ios Apps and Frameworks Engineer 2014 Apple Inc. All rights reserved.

More information

Mobile Application Programing: ios. Messaging

Mobile Application Programing: ios. Messaging Mobile Application Programing: ios Messaging Application Model View Controller (MVC) Application Controller User Action Update View Notify Update Model Messaging Controller User Action Update Notify Update

More information

Building Watch Apps #WWDC15. Featured. Session 108. Neil Desai watchos Engineer

Building Watch Apps #WWDC15. Featured. Session 108. Neil Desai watchos Engineer Featured #WWDC15 Building Watch Apps Session 108 Neil Desai watchos Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Agenda

More information

Announcements. Today s Topics

Announcements. Today s Topics Announcements Lab 2 is due tonight by 11:59 PM Late policy is 10% of lab total per day late So -7.5 points per day late for lab 2 Labs 3 and 4 are posted on the course website Extensible Networking Platform

More information

What s New in Testing

What s New in Testing #WWDC18 What s New in Testing Session 403 Honza Dvorsky, Xcode Engineer Ethan Vaughan, Xcode Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

Getting the Most Out of HealthKit

Getting the Most Out of HealthKit App Frameworks #WWDC16 Getting the Most Out of HealthKit What s new and best practices Session 209 Matthew Salesi ios Software Engineer Joefrey Kibuule ios Software Engineer 2016 Apple Inc. All rights

More information

What s New in Notifications

What s New in Notifications System Frameworks #WWDC15 What s New in Notifications Session 720 Michele Campeotto ios Notifications Gokul Thirumalai Apple Push Notification Service 2015 Apple Inc. All rights reserved. Redistribution

More information

Mobile Application Programming. Controls

Mobile Application Programming. Controls Mobile Application Programming Controls Views UIView instances and subclasses Form a tree rooted at the window Have a backing store of pixels that are drawn seldomly, then composited to form the full user

More information

Introducing On Demand Resources

Introducing On Demand Resources App Frameworks #WWDC15 Introducing On Demand Resources An element of App Thinning Session 214 Steve Lewallen Frameworks Engineering Tony Parker Cocoa Frameworks 2015 Apple Inc. All rights reserved. Redistribution

More information

What s New in imessage Apps

What s New in imessage Apps Session App Frameworks #WWDC17 What s New in imessage Apps 234 Eugene Bistolas, Messages Engineer Jay Chae, Messages Engineer Stephen Lottermoser, Messages Engineer 2017 Apple Inc. All rights reserved.

More information

ITP 342 Mobile App Dev. Collection View

ITP 342 Mobile App Dev. Collection View ITP 342 Mobile App Dev Collection View Collection View A collection view manages an ordered collection of items and presents them in a customizable layout. A collection view: Can contain optional views

More information

let w = UIWindow(frame: UIScreen.mainScreen().bounds)

let w = UIWindow(frame: UIScreen.mainScreen().bounds) PART I Views The things that appear in your app s interface are, ultimately, views. A view is a unit of your app that knows how to draw itself. A view also knows how to sense that the user has touched

More information

imessage Apps and Stickers, Part 2

imessage Apps and Stickers, Part 2 App Frameworks #WWDC16 imessage Apps and Stickers, Part 2 Interactive Messages Session 224 Alex Carter Messages Engineer Stephen Lottermoser Messages Engineer 2016 Apple Inc. All rights reserved. Redistribution

More information

COMP327 Mobile Computing Session: Lecture Set 1a - Swift Introduction and the Foundation Framework Part 2

COMP327 Mobile Computing Session: Lecture Set 1a - Swift Introduction and the Foundation Framework Part 2 COMP327 Mobile Computing Session: 2018-2019 Lecture Set 1a - Swift Introduction and the Foundation Framework Part 2 73 Other Swift Guard Already seen that for optionals it may be necessary to test that

More information

What s New in tvos 12

What s New in tvos 12 #WWDC18 What s New in tvos 12 Session 208 Hans Kim, tvos Engineering 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Agenda Agenda

More information

Objective-C Primer. iphone Programmer s Association. Lorenzo Swank September 10, 2008

Objective-C Primer. iphone Programmer s Association. Lorenzo Swank September 10, 2008 Objective-C Primer iphone Programmer s Association Lorenzo Swank September 10, 2008 Disclaimer Content was blatantly and unapologetically stolen from the WWDC 2007 Fundamentals of Cocoa session, as well

More information

Multitasking Support on the ios Platform

Multitasking Support on the ios Platform Multitasking Support on the ios Platform Priya Rajagopal Invicara (www.invicara.com) @rajagp Multitasking on ios? Multitasking allows apps to perform certain tasks in the background while you're using

More information

Rx in the real world. 1 Rob Ciolli

Rx in the real world. 1 Rob Ciolli Rx in the real world 1 Rob Ciolli 2 Rob Ciolli 3 Rob Ciolli The App 4 Rob Ciolli Quick architecture overview 5 Rob Ciolli MV - WTF 6 Rob Ciolli Model Simple, immutable data struct returned from DB or APIs

More information

CarPlay Audio and Navigation Apps

CarPlay Audio and Navigation Apps #WWDC18 CarPlay Audio and Navigation Apps Tunes and turns Jonathan Hersh, ios Car Experience Albert Wan, ios Car Experience Mike Knippers, ios Car Experience 2018 Apple Inc. All rights reserved. Redistribution

More information

New UIKit Support for International User Interfaces

New UIKit Support for International User Interfaces App Frameworks #WWDC15 New UIKit Support for International User Interfaces Session 222 Sara Radi Internationalization Software Engineer Aaltan Ahmad Internationalization Software Engineer Paul Borokhov

More information

Modern Auto Layout. Building Adaptive Layouts For ios. Keith Harrison. Web: useyourloaf.com Version: 1.0 ( ) Copyright 2018 Keith Harrison

Modern Auto Layout. Building Adaptive Layouts For ios. Keith Harrison. Web: useyourloaf.com Version: 1.0 ( ) Copyright 2018 Keith Harrison Building Adaptive Layouts For ios Keith Harrison Web: useyourloaf.com Version: 1.0 (2018-10-01) Copyright 2018 Keith Harrison Contents 1 Introduction 1 Why Learn Auto Layout?........................ 1

More information

Quick Interaction Techniques for watchos

Quick Interaction Techniques for watchos App Frameworks #WWDC16 Quick Interaction Techniques for watchos Session 211 Tom Witkin watchos Engineer Miguel Sanchez watchos Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display

More information

Building Apps with Dynamic Type

Building Apps with Dynamic Type Session App Frameworks #WWDC17 Building Apps with Dynamic Type 245 Clare Kasemset, Software Engineering Manager Nandini Sundar, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or

More information

Intro to Development for ios. Dave Koziol Arbormoon Software, Inc.

Intro to Development for ios. Dave Koziol Arbormoon Software, Inc. Intro to Development for ios Dave Koziol Arbormoon Software, Inc. About Me Long time Apple Developer (21 WWDCs) Organizer Ann Arbor CocoaHeads President & ios Developer at Arbormoon Software Inc. Multiple

More information

App. Chapter 19 App. App (ViewController) App. Single View Application Single View Application View. (View Controller)

App. Chapter 19 App. App (ViewController) App. Single View Application Single View Application View. (View Controller) Chapter 19 App App (ViewController) App 19.1 App App Single View Application Single View Application View Controller View Controller Label Button Button (View Controller) 2 View Controller Utility Area

More information

What s New in NSCollectionView Session 225

What s New in NSCollectionView Session 225 App Frameworks #WWDC15 What s New in NSCollectionView Session 225 Troy Stephens Application Frameworks Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without

More information

What s New in MapKit. App Frameworks #WWDC17. Fredrik Olsson

What s New in MapKit. App Frameworks #WWDC17. Fredrik Olsson Session App Frameworks #WWDC17 What s New in MapKit 237 Fredrik Olsson 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. MKMapView.mapType.standard

More information

Improving your Existing Apps with Swift

Improving your Existing Apps with Swift Developer Tools #WWDC15 Improving your Existing Apps with Swift Getting Swifty with It Session 403 Woody L. in the Sea of Swift 2015 Apple Inc. All rights reserved. Redistribution or public display not

More information

Intro to Native ios Development. Dave Koziol Arbormoon Software, Inc.

Intro to Native ios Development. Dave Koziol Arbormoon Software, Inc. Intro to Native ios Development Dave Koziol Arbormoon Software, Inc. About Me Long time Apple Developer (20 WWDCs) Organizer Ann Arbor CocoaHeads President & ios Developer at Arbormoon Software Inc. Wunder

More information

1 Build Your First App. The way to get started is to quit talking and begin doing. Walt Disney

1 Build Your First App. The way to get started is to quit talking and begin doing. Walt Disney 1 Build Your First App The way to get started is to quit talking and begin doing. Walt Disney Copyright 2015 AppCoda Limited All rights reserved. Please do not distribute or share without permission. No

More information

iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin Flashlight CodeTour TouchCount CodeTour

iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin Flashlight CodeTour TouchCount CodeTour iphone Programming Touch, Sound, and More! Norman McEntire Founder Servin 1 Legal Info iphone is a trademark of Apple Inc. Servin is a trademark of Servin Corporation 2 Welcome Welcome! Thank you! My promise

More information

Introductory ios Development

Introductory ios Development Introductory ios Development 152-164 Unit 5 - Multi-View Apps Quick Links & Text References What is a Delegate? What is a Protocol? Delegates, Protocols and TableViews Creating a Master-Detail App Modifying

More information

Building Visually Rich User Experiences

Building Visually Rich User Experiences Session App Frameworks #WWDC17 Building Visually Rich User Experiences 235 Noah Witherspoon, Software Engineer Warren Moore, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or public

More information

A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController.

A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController. WordPlay App: A Mad Libs app that you will navigate through 3 UIViewControllers to add text that will be shown in a story on the fourth UIViewController. Create a new project Create a new Xcode project

More information

ITP 342 Mobile App Dev. Animation

ITP 342 Mobile App Dev. Animation ITP 342 Mobile App Dev Animation Core Animation Introduced in Mac OS X Leopard Uses animatable "layers" built on OpenGL UIKit supports Core Animation out of the box Every UIView has a CALayer behind it

More information

Using and Extending the Xcode Source Editor

Using and Extending the Xcode Source Editor Developer Tools #WWDC16 Using and Extending the Xcode Source Editor Session 414 Mike Swingler Xcode Infrastructure and Editors Chris Hanson Xcode Infrastructure and Editors 2016 Apple Inc. All rights reserved.

More information

CSC 581: Mobile App Development Spring 2019

CSC 581: Mobile App Development Spring 2019 CSC 581: Mobile App Development Spring 2019 Unit 1: Getting Started with App Development Xcode installing XCode, creating a project, MVC pattern interface builder, storyboards, object library outlets vs.

More information

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar Design Patterns MSc in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Extending Your Apps with SiriKit

Extending Your Apps with SiriKit App Frameworks #WWDC16 Extending Your Apps with SiriKit Session 225 Vineet Khosla SiriKit Engineering Diana Huang SiriKit Engineering Scott Andrus SiriKit Engineering 2016 Apple Inc. All rights reserved.

More information

Building Mapping Apps for ios With Swift

Building Mapping Apps for ios With Swift Building Mapping Apps for ios With Swift Jeff Linwood This book is for sale at http://leanpub.com/buildingmappingappsforioswithswift This version was published on 2017-09-09 This is a Leanpub book. Leanpub

More information

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016

Stanford CS193p. Developing Applications for ios. Spring CS193p. Spring 2016 Stanford Developing Applications for ios Today Views Custom Drawing Demo FaceView Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space For drawing And for handling

More information

AdFalcon ios Native Ad SDK Developer's Guide. AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group

AdFalcon ios Native Ad SDK Developer's Guide. AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group AdFalcon ios Native Ad SDK 3.1.0 Developer's Guide AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group Table of Contents 1 Introduction... 4 Native Ads Overview... 4 OS version support...

More information

iphone Application Programming Lab 2: MVC and Delegation + A01 discussion

iphone Application Programming Lab 2: MVC and Delegation + A01 discussion Lab 2: MVC and Delegation + A01 discussion Nur Al-huda Hamdan RWTH Aachen University Winter Semester 2015/2016 http://hci.rwth-aachen.de/iphone Learning Objectives Discuss A01 + demo Concepts: debugging

More information

High Performance Auto Layout

High Performance Auto Layout #WWDC18 High Performance Auto Layout Ken Ferry, ios System Experience Kasia Wawer, ios Keyboards 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Miscellaneous Topics

Miscellaneous Topics Miscellaneous Topics Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline Renaming Xcode project and

More information

Getting the Most out of Playgrounds in Xcode

Getting the Most out of Playgrounds in Xcode #WWDC18 Getting the Most out of Playgrounds in Xcode Session 402 Tibet Rooney-Rabdau, Xcode Engineer Alex Brown, Core OS Engineer TJ Usiyan, Xcode Engineer 2018 Apple Inc. All rights reserved. Redistribution

More information

Introducing the Contacts Framework

Introducing the Contacts Framework App Frameworks #WWDC15 Introducing the Contacts Framework For OS X, ios, and watchos Session 223 Bruce Stadnyk ios Contacts Engineer Dave Dribin OS X Contacts Engineer Julien Robert ios Contacts Engineer

More information

Chapter 22 TableView TableView. TableView ios. ViewController. Cell TableViewCell TableView

Chapter 22 TableView TableView. TableView ios. ViewController. Cell TableViewCell TableView Chapter 22 TableView TableView Android TableView ListView App 22.1 TableView TableView Storyboard Table View ViewController TableView ios Cell TableViewCell TableView Table View Cell Cell ImageView (imageview)

More information

Mobile Development - Lab 2

Mobile Development - Lab 2 Mobile Development - Lab 2 Objectives Illustrate the delegation mechanism through examples Use a simple Web service Show how to simply make a hybrid app Display data with a grid layout Delegation pattern

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017

Stanford CS193p. Developing Applications for ios. Winter CS193p. Winter 2017 Stanford Developing Applications for ios Today Views Custom Drawing Demo FaceView Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space For drawing And for handling

More information

Adopting Advanced Features of the New UI

Adopting Advanced Features of the New UI Frameworks #WWDC14 Adopting Advanced Features of the New UI Session 220 Chris Dreessen AppKit Software Engineer! Corbin Dunn AppKit Software Engineer 2014 Apple Inc. All rights reserved. Redistribution

More information

Xcode 6 and ios 8 What s New for Software Developers

Xcode 6 and ios 8 What s New for Software Developers Xcode 6 and ios 8 What s New for Software Developers August 2014 Norman McEntire! norman.mcentire@servin.com Slides and Video of this presentation will be posted on Tuesday Aug 26 here: http://servin.com!1

More information

ios Core Data Example Application

ios Core Data Example Application ios Core Data Example Application The Core Data framework provides an abstract, object oriented interface to database storage within ios applications. This does not require extensive knowledge of database

More information

Building the App - Part 5 - Adding a Link

Building the App - Part 5 - Adding a Link Unit 4 - Coding For Your App Copy and Paste the code below exactly where the tutorials tell you. DO NOT COPY TEXT IN RED. Building the App - Part 5 - Adding a Link XCODE 7 @IBAction func Button1(_ sender:

More information

Use the API or contact customer service to provide us with the following: General ios Android App Name (friendly one-word name)

Use the API or contact customer service to provide us with the following: General ios Android App Name (friendly one-word name) Oplytic Attribution V 1.2.0 December 2017 Oplytic provides attribution for app-to-app and mobile-web-to-app mobile marketing. Oplytic leverages the tracking provided by Universal Links (ios) and App Links

More information

Creating Complications with ClockKit Session 209

Creating Complications with ClockKit Session 209 App Frameworks #WWDC15 Creating Complications with ClockKit Session 209 Eliza Block watchos Engineer Paul Salzman watchos Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display

More information

iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department

iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department iphone Programming Patrick H. Madden SUNY Binghamton Computer Science Department pmadden@acm.org http://optimal.cs.binghamton.edu General Outline Overview of the tools, and where to get more information

More information

User Experience: Windows & Views

User Experience: Windows & Views View Programming Guide for ios User Experience: Windows & Views 2010-07-07 Apple Inc. 2010 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or

More information

Event Delivery: The Responder Chain

Event Delivery: The Responder Chain When you design your app, it s likely that you want to respond to events dynamically. For example, a touch can occur in many different objects onscreen, and you have to decide which object you want to

More information

Managing Documents In Your ios Apps

Managing Documents In Your ios Apps Session #WWDC18 Managing Documents In Your ios Apps 216 Brandon Tennant, Software Engineer Thomas Deniau, Software Engineer Rony Fadel, Software Engineer 2018 Apple Inc. All rights reserved. Redistribution

More information

Accessibility on OS X

Accessibility on OS X Frameworks #WWDC14 Accessibility on OS X New Accessibility API Session 207 Patti Hoa Accessibility Engineer! Chris Dolan Accessibility Engineer 2014 Apple Inc. All rights reserved. Redistribution or public

More information

ios Application Development Lecture 5: Protocols, Extensions,TabBar an Scroll Views

ios Application Development Lecture 5: Protocols, Extensions,TabBar an Scroll Views ios Application Development Lecture 5: Protocols, Extensions,TabBar an Scroll Views Dr. Simon Völker & Philipp Wacker Media Computing Group RWTH Aachen University Winter Semester 2017/2018 http://hci.rwth-aachen.de/ios

More information

Introduction to WatchKit. CS193W - Spring Lecture 1

Introduction to WatchKit. CS193W - Spring Lecture 1 Introduction to WatchKit CS193W - Spring 2016 - Lecture 1 appleᴡᴀᴛᴄʜ Released April 24, 2015 No updates to the hardware yet. Three collections, over 30 models Two sizes The Screen OLED (organic light-emitting

More information

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015

Stanford CS193p. Developing Applications for ios. Winter CS193p! Winter 2015 Stanford CS193p Developing Applications for ios Today Objective-C Compatibility Bridging Property List NSUserDefaults Demo: var program in CalculatorBrain Views Custom Drawing Demo FaceView Bridging Objective-C

More information

Touch Bar Fundamentals

Touch Bar Fundamentals Session App Frameworks #WWDC17 Touch Bar Fundamentals 211 Chris Dreessen John Tegtmeyer 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from

More information

Chapter 2 Welcome App

Chapter 2 Welcome App 2.1 Introduction Chapter 2 Welcome App 1. A app is an app that can run on iphones, ipod touches and ipads. a. multi-purpose b. global c. unrestricted d. universal Ans: d. universal 2. You can your apps

More information

CSC 581: Mobile App Development Spring 2018

CSC 581: Mobile App Development Spring 2018 CSC 581: Mobile App Development Spring 2018 Unit 2: Introduciton to the UIKit UIKit, UIViews UIControl subclasses 1 UIKit the UIKit is a code framework for building mobile apps the foundational class for

More information

Building Faster in Xcode

Building Faster in Xcode #WWDC18 Building Faster in Xcode Session 408 David Owens, Xcode Engineer Jordan Rose, Swift Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

More information

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content

View Concepts. iphone Application Programming Lecture 4: User Interface Design. SDK provide many types of Views to show your content View Concepts iphone Application Programming Lecture 4: User Interface Design SDK provide many types of Views to show your content At run-time Views are organized as a tree Chat Wacharamanotham Media Computing

More information

INTRODUCTION TO ARCHITECTING YOUR IOS APP

INTRODUCTION TO ARCHITECTING YOUR IOS APP INTRODUCTION TO ARCHITECTING YOUR IOS APP AGENDA Goals of software architecture Design guidelines Practical tips GOALS OF SOFTWARE ARCHITECTURE GOALS OF SOFTWARE ARCHITECTURE Code is comprehensible for

More information

Designing for Apple Watch

Designing for Apple Watch Design #WWDC15 Designing for Apple Watch Session 802 Mike Stern User Experience Evangelist 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

What s New in Core Image

What s New in Core Image Media #WWDC15 What s New in Core Image Session 510 David Hayward Engineering Manager Tony Chu Engineer Alexandre Naaman Lead Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display

More information

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall

Stanford CS193p. Developing Applications for ios. Fall CS193p. Fall Stanford Developing Applications for ios Today Miscellaneous Error Handling Any Other Interesting Classes Views Custom Drawing Demo: Draw a Playing Card enum Thrown Errors In Swift, methods can throw errors

More information

ITP 342 Mobile App Dev. Connections

ITP 342 Mobile App Dev. Connections ITP 342 Mobile App Dev Connections User Interface Interactions First project displayed information to the user, but there was no interaction. We want the users of our app to touch UI components such as

More information

ITP 342 Mobile App Dev. Animation

ITP 342 Mobile App Dev. Animation ITP 342 Mobile App Dev Animation Views Views are the fundamental building blocks of your app's user interface, and the UIView class defines the behaviors that are common to all views. Responsibilities

More information

The MVC Design Pattern

The MVC Design Pattern The MVC Design Pattern The structure of iphone applications is based on the Model-View-Controller (MVC) design pattern because it benefits object-oriented programs in several ways. MVC based programs tend

More information

WatchKit In-Depth, Part 2

WatchKit In-Depth, Part 2 App Frameworks #WWDC15 WatchKit In-Depth, Part 2 Session 208 Nathan de Vries watchos Engineer Chloe Chang watchos Engineer 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted

More information

Tables. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder

Tables. Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Tables Mobile Application Development in ios School of EECS Washington State University Instructor: Larry Holder Mobile Application Development in ios 1 Outline Table View Controller Table View Table Cells

More information