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

Size: px
Start display at page:

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

Transcription

1 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 not permitted without written permission from Apple.

2 Why reduce memory Memory footprint Tools for profiling footprint Images Optimizing when in background Demo

3 Why Reduce Memory

4 Users have a better experience.

5 Memory Footprint Not all memory is created equal

6 Memory Footprint Pages

7 Memory Footprint Pages

8 Memory Footprint Pages UIView String UILabel

9 Memory Footprint Pages UIView Data String UILabel

10 Memory Footprint Pages Typically 16KB Page types Clean Dirty

11 Memory Footprint Pages Typically 16KB Page types Clean Dirty Number of pages x Page size = Memory in use

12 Memory Footprint Clean and dirty pages int *array = malloc(20000 * sizeof(int)); array[0] = 32 array[19999] = 64

13 Memory Footprint Clean and dirty pages int *array = malloc(20000 * sizeof(int)); array[0] = 32 array[19999] = 64

14 Memory Footprint Clean and dirty pages int *array = malloc(20000 * sizeof(int)); array[0] = 32 array[19999] = 64

15 Memory Footprint Clean and dirty pages int *array = malloc(20000 * sizeof(int)); array[0] = 32 array[19999] = 64

16 Memory Footprint Clean and dirty pages int *array = malloc(20000 * sizeof(int)); array[0] = 32 array[19999] = 64 32

17 Memory Footprint Clean and dirty pages int *array = malloc(20000 * sizeof(int)); array[0] = 32 array[19999] =

18 Memory Footprint Memory mapped files File-backed memory Read-only files are clean Kernel manages when file is in RAM

19 Memory Footprint Memory mapped files 50KB

20 Memory Footprint Memory mapped files 50KB

21 Memory Footprint Typical app memory profile Dirty Compressed Clean

22 Memory Footprint Clean memory Data that can be paged out of memory

23 Memory Footprint Clean memory Data that can be paged out of memory Clean Memory

24 Memory Footprint Clean memory Data that can be paged out of memory Memory mapped files Clean Memory

25 Memory Footprint Clean memory Data that can be paged out of memory Memory mapped files Image.jpg Blob.data Clean Memory Training.model

26 Memory Footprint Clean memory Data that can be paged out of memory Memory mapped files UIKit Frameworks* DATA_CONST Clean Memory CoreGraphics DATA_CONST

27 Memory Footprint Dirty memory

28 Memory Footprint Dirty memory Dirty Memory

29 Memory Footprint Dirty memory Memory written by an app Dirty Memory

30 Memory Footprint Dirty memory Memory written by an app All heap allocations malloc Array NSCache Dirty Memory UIViews String

31 Memory Footprint Dirty memory Memory written by an app All heap allocations CGRasterData Decoded image buffers Dirty Memory ImageIO

32 Memory Footprint Dirty memory Memory written by an app All heap allocations UIKit DATA Decoded image buffers DATA_DIRTY Frameworks Dirty CoreGraphics Memory DATA DATA_DIRTY

33 Memory Footprint Frameworks Frameworks contribute to dirty memory Singletons Global initializers +(void)load; +(void)initialize; // Objective-C // Objective-C attribute ((constructor)) // Objective-C initialize(); // Swift

34 Memory Footprint Compressed memory No traditional disk swap Memory compressor Compresses unaccessed pages Decompresses pages upon access

35 Memory Footprint Compressed memory No traditional disk swap Memory compressor Compresses unaccessed pages Decompresses pages upon access Dictionary NSData NSData

36 Memory Footprint Compressed memory No traditional disk swap Memory compressor Compresses unaccessed stale pages pages Decompresses pages upon access Dictionary NSData NSData

37 Memory Footprint Memory warnings App is not always the cause Compressor complicates freeing memory Prefer policy changes over cache purging

38 Memory Footprint Memory warnings override func didreceivememorywarning() { cache.removeallobjects() super.didreceivememorywarning() }

39 Memory Footprint Memory warnings override func didreceivememorywarning() { cache.removeallobjects() super.didreceivememorywarning() }

40 Memory Footprint Memory warnings override func didreceivememorywarning() { cache.removeallobjects() super.didreceivememorywarning() } Dictionary NSData NSData

41 Memory Footprint Memory warnings override func didreceivememorywarning() { cache.removeallobjects() super.didreceivememorywarning() } Dictionary NSData NSData

42 Memory Footprint Memory warnings override func didreceivememorywarning() { cache.removeallobjects() super.didreceivememorywarning() } Dictionary NSData NSData

43 Memory Footprint Caching Trade-offs between CPU and memory Remember the compressor Prefer NSCache over dictionary

44 Memory Footprint Typical app memory profile Dirty Compressed Clean

45 Memory Footprint Typical app memory profile Dirty Compressed Clean

46 Memory Footprint Typical app memory profile Footprint Dirty Compressed Clean

47 Memory Footprint Typical app memory profile Footprint limits Footprint Dirty Compressed Clean

48 Memory Footprint Typical app memory profile Footprint limits Footprint Limits vary by device Dirty Compressed Clean

49 Memory Footprint Typical app memory profile Footprint limits Footprint Limits vary by device Apps have a fairly high footprint limit Dirty Compressed Clean

50 Memory Footprint Typical app memory profile Footprint limits Footprint Limits vary by device Apps have a fairly high footprint limit Dirty Extensions have a much lower limit Compressed Clean

51 Memory Footprint Typical app memory profile Footprint limits Footprint Limits vary by device Apps have a fairly high footprint limit Dirty Extensions have a much lower limit Exception upon exceeding limit Compressed Clean

52 Memory Footprint Typical app memory profile Footprint limits Footprint Limits vary by device Apps have a fairly high footprint limit Dirty Extensions have a much lower limit Exception upon exceeding limit Compressed EXC_RESOURCE_EXCEPTION Clean

53 Tools for Profiling Footprint James Snee, Apple/Software Engineer

54 Tools for Profiling Footprint Xcode memory gauge

55 Tools for Profiling Footprint Xcode memory gauge

56 Tools for Profiling Footprint Xcode memory gauge

57 Tools for Profiling Footprint Instruments

58 Tools for Profiling Footprint Instruments Allocations Leaks VM Tracker Virtual memory trace

59 Tools for Profiling Footprint Instruments VM Tracker

60 Tools for Profiling Footprint Instruments VM Tracker

61 Tools for Profiling Footprint Instruments VM Tracker

62 Tools for Profiling Footprint Instruments Virtual Memory Trace

63 Tools for Profiling Footprint Instruments Virtual Memory Trace

64 Tools for Profiling Footprint Instruments Virtual Memory Trace

65 Tools for Profiling Footprint Xcode Debugger memory resource exceptions NEW

66 Tools for Profiling Footprint Xcode Debugger memory resource exceptions NEW

67 Tools for Profiling Footprint Xcode Debugger memory resource exceptions NEW

68 Tools for Profiling Footprint Xcode Memory Debugger

69 Tools for Profiling Footprint Xcode Memory Debugger

70 Tools for Profiling Footprint Xcode Memory Debugger

71 Tools for Profiling Footprint Xcode Memory Debugger

72 Tools for Profiling Footprint vmmap NEW Shows virtual memory regions allocated in a process vmmap App.memgraph vmmap --summary App.memgraph

73 Tools for Profiling Footprint vmmap --summary App.memgraph

74 Tools for Profiling Footprint vmmap --summary App.memgraph

75 Tools for Profiling Footprint vmmap --summary App.memgraph

76 Tools for Profiling Footprint vmmap --summary App.memgraph

77 Tools for Profiling Footprint Zoom and focus vmmap App.memgraph

78 Tools for Profiling Footprint Zoom and focus vmmap App.memgraph

79 Tools for Profiling Footprint vmmap App.memgraph

80 Tools for Profiling Footprint vmmap App.memgraph

81 Tools for Profiling Footprint vmmap and AWK

82 Tools for Profiling Footprint vmmap and AWK

83 Tools for Profiling Footprint vmmap and AWK

84 Tools for Profiling Footprint vmmap and AWK

85 Tools for Profiling Footprint vmmap and AWK

86 Tools for Profiling Footprint vmmap and AWK

87 Tools for Profiling Footprint leaks NEW Shows objects that are allocated, but no longer referenced leaks App.memgraph

88 Tools for Profiling Footprint leaks

89 Tools for Profiling Footprint leaks

90 Tools for Profiling Footprint leaks MyApp.memgraph NEW

91 Tools for Profiling Footprint leaks MyApp.memgraph NEW

92 Tools for Profiling Footprint leaks MyApp.memgraph NEW

93 Tools for Profiling Footprint leaks MyApp.memgraph NEW

94 Tools for Profiling Footprint heap NEW Shows objects allocated on the heap Useful for identifying large objects in memory and what allocated it heap App.memgraph heap App.memgraph -sortbysize heap App.memgraph -addresses all <classes-pattern>

95 Tools for Profiling Footprint heap App.memgraph

96 Tools for Profiling Footprint heap App.memgraph

97 Tools for Profiling Footprint heap App.memgraph

98 Tools for Profiling Footprint heap App.memgraph

99 Tools for Profiling Footprint heap App.memgraph

100 Tools for Profiling Footprint heap --sortbysize App.memgraph

101 Tools for Profiling Footprint heap --sortbysize App.memgraph

102 Tools for Profiling Footprint heap App.memgraph -addresses all <classes-pattern>

103 Tools for Profiling Footprint heap App.memgraph -addresses all <classes-pattern>

104 Tools for Profiling Footprint Enabling malloc stack logging

105 Tools for Profiling Footprint Enabling malloc stack logging

106 Tools for Profiling Footprint malloc_history NEW Shows backtraces for malloc and anonymous VM region allocations malloc_history App.memgraph [address]

107 Tools for Profiling Footprint malloc_history <memgraph> <address>

108 Tools for Profiling Footprint malloc_history <memgraph> <address>

109 Tools for Profiling Footprint Which tool to pick?

110 Tools for Profiling Footprint Which tool to pick? Creation Reference Size

111 Tools for Profiling Footprint Which tool to pick? Creation Reference Size malloc_history

112 Tools for Profiling Footprint Which tool to pick? Creation Reference Size malloc_history leaks

113 Tools for Profiling Footprint Which tool to pick? Creation Reference Size malloc_history leaks vmmap, heap

114 Images Kyle Howarth, Apple/Software Engineer

115 Memory use is related to the dimensions of the image, not the file size.

116 Images 590Kb file size

117 Images 590KB file size

118 Images 2048px 1536px 590KB file size

119 10MB 2048 pixels x 1536 pixels x 4 bytes per pixel

120 Images Load Decode Render

121 Images Load 590Kb

122 Images Load Decode 590KB 10MB

123 Images Load Decode Render 590KB 10MB Images and Graphics Best Practices WWWDC 2018

124 Images Image-rendering formats SRGB Format Four bytes per pixel Full color images

125 Images Image-rendering formats Wide format Eight bytes per pixel Super accurate colors Only useful with wide color displays Wide color capture cameras - iphone 7, iphone 8, iphone X, ipad Pro 10.5, ipad Pro 13 (2nd generation)

126 Images Image rendering formats Luminance and alpha 8 format Two bytes per pixel Single-color images and alpha Metal shaders

127 Images Image rendering formats Alpha 8 Format One byte per pixel Useful for monochrome images - Masks - Emoji-free text 75 percent smaller than SRGB

128 Images Image rendering formats Optimized formats reduce memory use One byte: Alpha 8 Two bytes: luminance and alpha 8 Four bytes: SRGB Eight bytes: wide format

129 How do I pick the right format?

130 Images Picking the right format Don t pick the format, let the format pick you Stop using UIGraphicsBeginImageContextWithOptions Four bytes per pixel format Start or keep using UIGraphicsImageRenderer Introduced in ios 10 Automatically picks best graphics format in ios 12

131 // Circle via UIGraphicsImageContext let bounds = CGRect(x: 0, y: 0, width:300, height: 100) UIGraphicsBeginImageContextWithOptions(bounds.size, false, 0) // Drawing Code UIColor.black.setFill() let path = UIBezierPath(roundedRect: bounds, byroundingcorners: UIRectCorner.allCorners, cornerradii: CGSize(width: 20, height: 20)) path.addclip() UIRectFill(bounds) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()

132 // Circle via UIGraphicsImageContext let bounds = CGRect(x: 0, y: 0, width:300, height: 100) UIGraphicsBeginImageContextWithOptions(bounds.size, false, 0) // Drawing Code UIColor.black.setFill() let path = UIBezierPath(roundedRect: bounds, byroundingcorners: UIRectCorner.allCorners, cornerradii: CGSize(width: 20, height: 20)) path.addclip() UIRectFill(bounds) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()

133 // Circle via UIGraphicsImageRenderer let bounds = CGRect(x: 0, y: 0, width:300, height: 100) let renderer = UIGraphicsImageRenderer(size: bounds.size) let image = renderer.image { context in // Drawing Code UIColor.black.setFill() let path = UIBezierPath(roundedRect: bounds, byroundingcorners: UIRectCorner.allCorners, cornerradii: CGSize(width: 20, height: 20)) path.addclip() UIRectFill(bounds) }

134 // Circle via UIGraphicsImageRenderer let bounds = CGRect(x: 0, y: 0, width:300, height: 100) let renderer = UIGraphicsImageRenderer(size: bounds.size) let image = renderer.image { context in // Drawing Code UIColor.black.setFill() let path = UIBezierPath(roundedRect: bounds, byroundingcorners: UIRectCorner.allCorners, cornerradii: CGSize(width: 20, height: 20)) path.addclip() UIRectFill(bounds) }

135 // Circle via UIGraphicsImageRenderer let bounds = CGRect(x: 0, y: 0, width:300, height: 100) let renderer = UIGraphicsImageRenderer(size: bounds.size) let image = renderer.image { context in // Drawing Code UIColor.black.setFill() let path = UIBezierPath(roundedRect: bounds, byroundingcorners: UIRectCorner.allCorners, cornerradii: CGSize(width: 20, height: 20)) path.addclip() UIRectFill(bounds) } // Make circle render blue, but stay at 1 byte-per-pixel image let imageview = UIImageView(image: image) imageview.tintcolor =.blue

136 // Circle via UIGraphicsImageRenderer let bounds = CGRect(x: 0, y: 0, width:300, height: 100) let renderer = UIGraphicsImageRenderer(size: bounds.size) let image = renderer.image { context in // Drawing Code UIColor.black.setFill() let path = UIBezierPath(roundedRect: bounds, byroundingcorners: UIRectCorner.allCorners, cornerradii: CGSize(width: 20, height: 20)) path.addclip() UIRectFill(bounds) } // Make circle render blue, but stay at 1 byte-per-pixel image let imageview = UIImageView(image: image) imageview.tintcolor =.blue

137 // Circle via UIGraphicsImageRenderer let bounds = CGRect(x: 0, y: 0, width:300, height: 100) let renderer = UIGraphicsImageRenderer(size: bounds.size) let image = renderer.image { context in // Drawing Code UIColor.black.setFill() let path = UIBezierPath(roundedRect: bounds, byroundingcorners: UIRectCorner.allCorners, cornerradii: CGSize(width: 20, height: 20)) path.addclip() UIRectFill(bounds) } // Make circle render blue, but stay at 1 byte-per-pixel image let imageview = UIImageView(image: image) imageview.tintcolor =.blue

138 Images Downsampling UIImage is expensive for sizing and to resizing Will decompress original image into memory Internal coordinate space transforms are expensive ImageIO can read image sizes and metadata information without dirtying memory ImageIO can resize images at cost of resized image only

139 // Image size with UIImage import UIKit // Getting image size let filepath = /path/to/image.jpg let image = UIImage(contentsOfFile: filepath) let imagesize = image.size // Resizing image let scale = 0.2 let size = CGSize(image.size.width * scale, image.size.height * scale) let renderer = UIGraphicsImageRenderer(size: size) let resizedimage = renderer.image { context in image.draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) }

140 // Image size with UIImage import UIKit // Getting image size let filepath = /path/to/image.jpg let image = UIImage(contentsOfFile: filepath) let imagesize = image.size // Resizing image let scale = 0.2 let size = CGSize(image.size.width * scale, image.size.height * scale) let renderer = UIGraphicsImageRenderer(size: size) let resizedimage = renderer.image { context in image.draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) }

141 // Image size with UIImage import UIKit // Getting image size let filepath = /path/to/image.jpg let image = UIImage(contentsOfFile: filepath) let imagesize = image.size // Resizing image let scale = 0.2 let size = CGSize(image.size.width * scale, image.size.height * scale) let renderer = UIGraphicsImageRenderer(size: size) let resizedimage = renderer.image { context in image.draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) }

142 // Image size with ImageIO import ImageIO let filepath = /path/to/image.jpg let url = NSURL(fileURLWithPath: path) let imagesource = CGImageSourceCreateWithURL(url, nil) let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil) let options: [NSString: Any] = [ kcgimagesourcethumbnailmaxpixelsize: 100, kcgimagesourcecreatethumbnailfromimagealways: true ] let scaledimage = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options)

143 // Image size with ImageIO import ImageIO let filepath = /path/to/image.jpg let url = NSURL(fileURLWithPath: path) let imagesource = CGImageSourceCreateWithURL(url, nil) let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil) let options: [NSString: Any] = [ kcgimagesourcethumbnailmaxpixelsize: 100, kcgimagesourcecreatethumbnailfromimagealways: true ] let scaledimage = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options)

144 // Image size with ImageIO import ImageIO let filepath = /path/to/image.jpg let url = NSURL(fileURLWithPath: path) let imagesource = CGImageSourceCreateWithURL(url, nil) let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil) let options: [NSString: Any] = [ kcgimagesourcethumbnailmaxpixelsize: 100, kcgimagesourcecreatethumbnailfromimagealways: true ] let scaledimage = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options)

145 // Image size with ImageIO import ImageIO let filepath = /path/to/image.jpg let url = NSURL(fileURLWithPath: path) let imagesource = CGImageSourceCreateWithURL(url, nil) let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, nil) let options: [NSString: Any] = [ kcgimagesourcethumbnailmaxpixelsize: 100, kcgimagesourcecreatethumbnailfromimagealways: true ] let scaledimage = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options)

146 Optimizing when in the background

147

148

149 Unload large resources you cannot see.

150 Optimizing When in the Background Unloading when off-screen App lifecycle Listen for UIApplicationWillEnterForeground and UIApplicationDidEnterBackground notifications Applies to on-screen views UIViewController appearance cycle Leverage viewwillappear and viewdiddisappear Off-screen view controllers in UITabBarController and UINavigationController

151 // Unloading resources on foreground/background NotificationCenter.default.addObserver(forName:.UIApplicationDidEnterBackground, object: nil, queue:.main) { [weak self] (note) in // Unload large resources when off-screen self.unloadimages() } NotificationCenter.default.addObserver(forName:.UIApplicationWillEnterForeground, object: nil, queue:.main) { [weak self] (note) in // Load large resources when off-screen self.loadimages() }

152 // Unloading resources on foreground/background NotificationCenter.default.addObserver(forName:.UIApplicationDidEnterBackground, object: nil, queue:.main) { [weak self] (note) in // Unload large resources when off-screen self.unloadimages() } NotificationCenter.default.addObserver(forName:.UIApplicationWillEnterForeground, object: nil, queue:.main) { [weak self] (note) in // Load large resources when off-screen self.loadimages() }

153 // Unloading resources on foreground/background NotificationCenter.default.addObserver(forName:.UIApplicationDidEnterBackground, object: nil, queue:.main) { [weak self] (note) in // Unload large resources when off-screen self.unloadimages() } NotificationCenter.default.addObserver(forName:.UIApplicationWillEnterForeground, object: nil, queue:.main) { [weak self] (note) in // Load large resources when off-screen self.loadimages() }

154 // Unloading resources on foreground/background // Unload large resource when off-screen override func viewdiddisappear(_ animated: Bool) { unloadimages() super.viewdiddisappear(animated) } // Load large resources when on-screen override func viewwillappear(_ animated: Bool) { loadimages() super.viewwillappear(animated) }

155 // Unloading resources on foreground/background // Unload large resource when off-screen override func viewdiddisappear(_ animated: Bool) { unloadimages() super.viewdiddisappear(animated) } // Load large resources when on-screen override func viewwillappear(_ animated: Bool) { loadimages() super.viewwillappear(animated) }

156 // Unloading resources on foreground/background // Unload large resource when off-screen override func viewdiddisappear(_ animated: Bool) { unloadimages() super.viewdiddisappear(animated) } // Load large resources when on-screen override func viewwillappear(_ animated: Bool) { loadimages() super.viewwillappear(animated) }

157 Demo Kris Markel, Apple/Software Engineer

158 Summary

159 Summary Memory is a finite and shared resource

160 Summary Memory is a finite and shared resource Monitor memory use when running from Xcode

161 Summary Memory is a finite and shared resource Monitor memory use when running from Xcode Let ios pick your image formats

162 Summary Memory is a finite and shared resource Monitor memory use when running from Xcode Let ios pick your image formats Use ImageIO for downsampling images

163 Summary Memory is a finite and shared resource Monitor memory use when running from Xcode Let ios pick your image formats Use ImageIO for downsampling images Unload large resources that are off-screen

164 Summary Memory is a finite and shared resource Monitor memory use when running from Xcode Let ios pick your image formats Use ImageIO for downsampling images Unload large resources that are off-screen Use memory graphs to further understand and reduce memory footprint

165 Summary Memory is a finite and shared resource Monitor memory use when running from Xcode Let ios pick your image formats Use ImageIO for downsampling images Unload large resources that are off-screen Use memory graphs to further understand and reduce memory footprint

166 More Information

167

Cocoa Touch Best Practices

Cocoa Touch Best Practices 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

More information

Integrating Apps and Content with AR Quick Look

Integrating Apps and Content with AR Quick Look Session #WWDC18 Integrating Apps and Content with AR Quick Look 603 David Lui, ARKit Engineering Dave Addey, ARKit Engineering 2018 Apple Inc. All rights reserved. Redistribution or public display not

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

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

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

View Controller Lifecycle

View Controller Lifecycle View Controller Lifecycle View Controllers have a Lifecycle A sequence of messages is sent to them as they progress through it Why does this matter? You very commonly override these methods to do certain

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

View Controllers CPRE 388

View Controllers CPRE 388 View Controllers CPRE 388 View Controllers Manage views in model view controller design template. Many types: custom view controller; container view controller; modal view controller. Custom View controllers

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

Introducing PDFKit on ios

Introducing PDFKit on ios Session App Frameworks #WWDC17 Introducing PDFKit on ios PDF on macos and ios 241 Jeremy Bridon, Software Engineer Nicki Brower, Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or

More information

Lecture 8 Demo Code: Cassini Multithreading

Lecture 8 Demo Code: Cassini Multithreading Lecture 8 Demo Code: Cassini Multithreading Objective Included below is the source code for the demo in lecture. It is provided under the same Creative Commons licensing as the rest of CS193p s course

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

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

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

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 Memory Management for Reference Types Controlling when things leave the heap Closure Capture Closures capture things into the heap too Extensions A simple,

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

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010 Developing Applications for iphone 4, ipod Touch, & ipad Today Blocks Language syntax for declaring a function on the fly. Grand Central Dispatch C API for leveraging blocks to make writing multithreaded

More information

ios Mobile Development

ios Mobile Development ios Mobile Development Today UITextView Scrollable, editable/selectable view of a mutable attributed string. View Controller Lifecycle Finding out what s happening as a VC is created, hooked up to the

More information

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

Stanford CS193p. Developing Applications for ios. Fall Stanford CS193p. Fall 2011 Developing Applications for ios Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Draws and handles events in that rectangle Hierarchical A view has only one

More information

Advanced Memory Analysis with Instruments. Daniel Delwood Performance Tools Engineer

Advanced Memory Analysis with Instruments. Daniel Delwood Performance Tools Engineer Advanced Memory Analysis with Instruments Daniel Delwood Performance Tools Engineer 2 Memory Analysis What s the issue? Memory is critical to performance Limited resource Especially on iphone OS 3 4 Memory

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

Designing iphone Applications

Designing iphone Applications Designing iphone Applications 4 Two Flavors of Mail 5 Organizing Content 6 Organizing Content 6 Organizing Content 6 Organizing Content 6 Organizing Content Focus on your user s data 6 Organizing Content

More information

What s New in Xcode App Signing

What s New in Xcode App Signing Developer Tools #WWDC16 What s New in Xcode App Signing Developing and distributing Session 401 Joshua Pennington Tools Engineering Manager Itai Rom Tools Engineer 2016 Apple Inc. All rights reserved.

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 Error Handling in Swift try Extensions A simple, powerful, but easily overused code management syntax Protocols Last (but certainly not least important) typing

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

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

Working with Metal Overview

Working with Metal Overview Graphics and Games #WWDC14 Working with Metal Overview Session 603 Jeremy Sandmel GPU Software 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

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

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5

iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 iphone App Basics iphone and ipod touch Development Fall 2009 Lecture 5 Questions? Announcements Assignment #1 due this evening by 11:59pm Remember, if you wish to use a free late you must email me before

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

IOS PERFORMANCE. Getting the most out of your Games and Apps

IOS PERFORMANCE. Getting the most out of your Games and Apps IOS PERFORMANCE Getting the most out of your Games and Apps AGENDA Intro to Performance The top 10 optimizations for your games and apps Instruments & Example Q&A WHO AM I? Founder of Prop Group www.prop.gr

More information

Memory Hierarchy Requirements. Three Advantages of Virtual Memory

Memory Hierarchy Requirements. Three Advantages of Virtual Memory CS61C L12 Virtual (1) CS61CL : Machine Structures Lecture #12 Virtual 2009-08-03 Jeremy Huddleston Review!! Cache design choices: "! Size of cache: speed v. capacity "! size (i.e., cache aspect ratio)

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

Introducing Metal 2. Graphics and Games #WWDC17. Michal Valient, GPU Software Engineer Richard Schreyer, GPU Software Engineer

Introducing Metal 2. Graphics and Games #WWDC17. Michal Valient, GPU Software Engineer Richard Schreyer, GPU Software Engineer Session Graphics and Games #WWDC17 Introducing Metal 2 601 Michal Valient, GPU Software Engineer Richard Schreyer, GPU Software Engineer 2017 Apple Inc. All rights reserved. Redistribution or public display

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

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

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

Data Delivery with Drag and Drop

Data Delivery with Drag and Drop Session App Frameworks #WWDC17 Data Delivery with Drag and Drop 227 Dave Rahardja, UIKit Tanu Singhal, UIKit 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without

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

Assignment III: Graphing Calculator

Assignment III: Graphing Calculator Assignment III: Graphing Calculator Objective The goal of this assignment is to reuse your CalculatorBrain and CalculatorViewController objects to build a Graphing Calculator. By doing this, you will gain

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

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

Finding Bugs Using Xcode Runtime Tools

Finding Bugs Using Xcode Runtime Tools Session Developer Tools #WWDC17 Finding Bugs Using Xcode Runtime Tools 406 Kuba Mracek, Program Analysis Engineer Vedant Kumar, Compiler Engineer 2017 Apple Inc. All rights reserved. Redistribution or

More information

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

Stanford CS193p. Developing Applications for ios. Spring Stanford CS193p. Spring 2012 Developing Applications for ios Today Blocks Objective-C language feature for in-lining blocks of code Foundation of multi-threaded support (GCD) What is a block? A block of code (i.e. a sequence of statements

More information

CS 333 Introduction to Operating Systems. Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University

CS 333 Introduction to Operating Systems. Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University CS 333 Introduction to Operating Systems Class 11 Virtual Memory (1) Jonathan Walpole Computer Science Portland State University Virtual addresses Virtual memory addresses (what the process uses) Page

More information

Media Playback and Recording. CS193W - Spring Lecture 3

Media Playback and Recording. CS193W - Spring Lecture 3 Media Playback and Recording CS193W - Spring 2016 - Lecture 3 Today Images and animated images Text input controller Media playback controller Inline video playback Playing extended audio Recording audio

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

Profiling in Depth. Do you know where your code is? Session 412. Kris Markel Performance Tools Engineer Chad Woolf Performance Tools Engineer

Profiling in Depth. Do you know where your code is? Session 412. Kris Markel Performance Tools Engineer Chad Woolf Performance Tools Engineer Developer Tools #WWDC15 Profiling in Depth Do you know where your code is? Session 412 Kris Markel Performance Tools Engineer Chad Woolf Performance Tools Engineer 2015 Apple Inc. All rights reserved.

More information

Custom Drawing & Animation. CS 442: Mobile App Development Michael Saelee

Custom Drawing & Animation. CS 442: Mobile App Development Michael Saelee Custom Drawing & Animation CS 442: Mobile App Development Michael Saelee Frameworks - UIKit - Core Graphics / Quartz - Core Animation - OpenGL ES UIKit OpenGL ES Core Graphics Core Animation

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

ios SDK Release Notes for ios 10.1 Beta 1

ios SDK Release Notes for ios 10.1 Beta 1 ios SDK Release Notes for ios 10.1 Beta 1 apple Developer apple Copyright 2016 Apple Inc. All rights reserved. Terms of Use. Privacy Policy. Page 2 of 2 Introduction... 2 Bug Reporting... 2 Autosubmission

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

Creating Photo and Video Effects Using Depth

Creating Photo and Video Effects Using Depth Session #WWDC18 Creating Photo and Video Effects Using Depth 503 Emmanuel Piuze-Phaneuf, Core Image Ron Sokolovsky, Video Engineering 2018 Apple Inc. All rights reserved. Redistribution or public display

More information

Memory Management Topics. CS 537 Lecture 11 Memory. Virtualizing Resources

Memory Management Topics. CS 537 Lecture 11 Memory. Virtualizing Resources Memory Management Topics CS 537 Lecture Memory Michael Swift Goals of memory management convenient abstraction for programming isolation between processes allocate scarce memory resources between competing

More information

Optimizing Swift Performance Session 409

Optimizing Swift Performance Session 409 Developer Tools #WWDC15 Optimizing Swift Performance Session 409 Nadav Rotem Manager, Swift Performance Team Michael Gottesman Engineer, Swift Performance Team Joe Grzywacz Engineer, Performance Tools

More information

Announcement. Final Project Proposal Presentations and Updates

Announcement. Final Project Proposal Presentations and Updates Announcement Start Final Project Pitches on Wednesday Presentation slides dues by Tuesday at 11:59 PM Email slides to cse438ta@gmail.com Extensible Networking Platform 1 1 - CSE 438 Mobile Application

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Paged MMU: Two main Issues Translation speed can be slow TLB Table size is big Multi-level page table

More information

} override func didreceivememorywarning() { 26 super.didreceivememorywarning() 27 } 28 } Pause Stop

} override func didreceivememorywarning() { 26 super.didreceivememorywarning() 27 } 28 } Pause Stop Chapter 30 30.1 App App MP3 Don t Download This Song [1] Finder MP3 Xcode UI 1 import UIKit 2 import AVFoundation 3 4 class ViewController: UIViewController { 5 6 var player: AVAudioPlayer? 7 8 override

More information

Another View of the Memory Hierarchy. Lecture #25 Virtual Memory I Memory Hierarchy Requirements. Memory Hierarchy Requirements

Another View of the Memory Hierarchy. Lecture #25 Virtual Memory I Memory Hierarchy Requirements. Memory Hierarchy Requirements CS61C L25 Virtual I (1) inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #25 Virtual I 27-8-7 Scott Beamer, Instructor Another View of the Hierarchy Thus far{ Next: Virtual { Regs Instr.

More information

Vision Framework. Building on Core ML. Media #WWDC17. Brett Keating, Apple Manager Frank Doepke, He who wires things together

Vision Framework. Building on Core ML. Media #WWDC17. Brett Keating, Apple Manager Frank Doepke, He who wires things together Session Media #WWDC17 Vision Framework Building on Core ML 506 Brett Keating, Apple Manager Frank Doepke, He who wires things together 2017 Apple Inc. All rights reserved. Redistribution or public display

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

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

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

OVERVIEW. Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net

OVERVIEW. Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net OVERVIEW Why learn ios programming? Share first-hand experience. Identify platform differences. Identify similarities with.net Microsoft MVP for 4 years C#, WinForms, WPF, Silverlight Joined Cynergy about

More information

Metal for Ray Tracing Acceleration

Metal for Ray Tracing Acceleration Session #WWDC18 Metal for Ray Tracing Acceleration 606 Sean James, GPU Software Engineer Wayne Lister, GPU Software Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted

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

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

Operating Systems. Overview Virtual memory part 2. Page replacement algorithms. Lecture 7 Memory management 3: Virtual memory

Operating Systems. Overview Virtual memory part 2. Page replacement algorithms. Lecture 7 Memory management 3: Virtual memory Operating Systems Lecture 7 Memory management : Virtual memory Overview Virtual memory part Page replacement algorithms Frame allocation Thrashing Other considerations Memory over-allocation Efficient

More information

Virtual Memory. Kevin Webb Swarthmore College March 8, 2018

Virtual Memory. Kevin Webb Swarthmore College March 8, 2018 irtual Memory Kevin Webb Swarthmore College March 8, 2018 Today s Goals Describe the mechanisms behind address translation. Analyze the performance of address translation alternatives. Explore page replacement

More information

What's New in Core Spotlight

What's New in Core Spotlight Session System Frameworks #WWDC17 What's New in Core Spotlight Search on macos and ios 231 John Hörnkvist, Spotlight Lyn Fong, Spotlight 2017 Apple Inc. All rights reserved. Redistribution or public display

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory Disk

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

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

Advanced Debugging and the Address Sanitizer

Advanced Debugging and the Address Sanitizer Developer Tools #WWDC15 Advanced Debugging and the Address Sanitizer Finding your undocumented features Session 413 Mike Swingler Xcode UI Infrastructure Anna Zaks LLVM Program Analysis 2015 Apple Inc.

More information

Announcements. Lab 2 is due next Monday (Sept 25 th ) by 11:59 PM. Late policy is 10% of lab total per day late. So -7.5 points per day late for lab 2

Announcements. Lab 2 is due next Monday (Sept 25 th ) by 11:59 PM. Late policy is 10% of lab total per day late. So -7.5 points per day late for lab 2 Announcements Lab 2 is due next Monday (Sept 25 th ) 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

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

Views. A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space

Views. A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Views A view (i.e. UIView subclass) represents a rectangular area Defines a coordinate space Draws and handles events in that rectangle Hierarchical A view has only one superview - (UIView *)superview

More information

CS 550 Operating Systems Spring Memory Management: Paging

CS 550 Operating Systems Spring Memory Management: Paging CS 550 Operating Systems Spring 2018 Memory Management: Paging 1 Recap: Memory Management Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive

More information

Introducing the Photos Frameworks

Introducing the Photos Frameworks Media #WWDC14 Introducing the Photos Frameworks Session 511 Adam Swift ios Photos Frameworks 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

What s New in Energy Debugging

What s New in Energy Debugging #WWDC18 What s New in Energy Debugging Phillip Azar, Apple/Battery Life David Choi, Apple/Battery Life 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written

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

What s New in watchos

What s New in watchos Session App Frameworks #WWDC17 What s New in watchos 205 Ian Parks, watchos Engineering 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from

More information

What s New in SpriteKit

What s New in SpriteKit Graphics and Games #WWDC16 What s New in SpriteKit Session 610 Ross Dexter Games Technologies Engineer Clément Boissière Games Technologies Engineer 2016 Apple Inc. All rights reserved. Redistribution

More information

Developing Applications for ios

Developing Applications for ios Developing Applications for ios Lecture 7: View Controller Lifecycle and UIKit Radu Ionescu raducu.ionescu@gmail.com Faculty of Mathematics and Computer Science University of Bucharest Content View Controller

More information

Thread Sanitizer and Static Analysis

Thread Sanitizer and Static Analysis Developer Tools #WWDC16 Thread Sanitizer and Static Analysis Help with finding bugs in your code Session 412 Anna Zaks Manager, Program Analysis Team Devin Coughlin Engineer, Program Analysis Team 2016

More information

Creating Audio Apps for watchos

Creating Audio Apps for watchos Session #WWDC18 Creating Audio Apps for watchos 504 Neil Desai, watchos Frameworks Engineer 2018 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

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

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

UC Berkeley CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 35 Virtual Memory II 2007-04-16 Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia Hardware repair?! This technology allows

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

Memory Management: High-Level Overview

Memory Management: High-Level Overview Lecture 9 : High-Level Overview Gaming Memory (Last Generation) Playstation 3 256 MB RAM for system 256 MB for graphics card X-Box 360 512 MB RAM (unified) Nintendo Wii 88 MB RAM (unified) 24 MB for graphics

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

SceneKit: What s New Session 604

SceneKit: What s New Session 604 Graphics and Games #WWDC17 SceneKit: What s New Session 604 Thomas Goossens, SceneKit engineer Amaury Balliet, SceneKit engineer Anatole Duprat, SceneKit engineer Sébastien Métrot, SceneKit engineer 2017

More information

ITP 342 Advanced Mobile App Dev. Memory

ITP 342 Advanced Mobile App Dev. Memory ITP 342 Advanced Mobile App Dev Memory Memory Management Objective-C provides two methods of application memory management. 1. In the method described in this guide, referred to as manual retain-release

More information

What s New in Metal, Part 2

What s New in Metal, Part 2 Graphics and Games #WWDC15 What s New in Metal, Part 2 Session 607 Dan Omachi GPU Software Frameworks Engineer Anna Tikhonova GPU Software Frameworks Engineer 2015 Apple Inc. All rights reserved. Redistribution

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Demand paging Concepts to Learn 2 Abstraction Virtual Memory (VM) 4GB linear address space for each process

More information

CS193P - Lecture 10. iphone Application Development. Performance

CS193P - Lecture 10. iphone Application Development. Performance CS193P - Lecture 10 iphone Application Development Performance 1 Announcements 2 Announcements Paparazzi 2 is due next Wednesday at 11:59pm 2 Announcements Paparazzi 2 is due next Wednesday at 11:59pm

More information

Using Accelerate and simd

Using Accelerate and simd Session #WWDC18 Using Accelerate and simd 701 Matthew Badin, CoreOS, Vector and Numerics Luke Chang, CoreOS, Vector and Numerics 2018 Apple Inc. All rights reserved. Redistribution or public display not

More information

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010

Stanford CS193p. Developing Applications for iphone 4, ipod Touch, & ipad Fall Stanford CS193p Fall 2010 Developing Applications for iphone 4, ipod Touch, & ipad Today One last Objective-C topic: Protocols Using protocols to define/implement/use a data source and/or delegate Views UIView and UIWindow classes

More information

Profiling & Optimization

Profiling & Optimization Lecture 11 Sources of Game Performance Issues? 2 Avoid Premature Optimization Novice developers rely on ad hoc optimization Make private data public Force function inlining Decrease code modularity removes

More information