SlideShare a Scribd company logo
1 of 87
Download to read offline
Multitasking
The Hard Way
@micheletitolo

Lead Software Engineer, Capital One
What We’ll Cover
What are Multitasking and Adaptivity?

Creating Adaptivity

Tips, Tricks, and Gotchas
What Is Multitasking?
Adaptivity
Compact
Compact
Regular
Regular
✔
✔✔
x
Creating Adaptivity
• Launch.storyboard

• Full iPad rotation

• UITraitCollection
Mechanics
Apps Must Use A
Launch.Storyboard
Apps Must Allow
Full Rotation
Setting in Info.plist
UITraitCollection
horizontalSizeClass

verticalSizeClass
UITraitEnvironment

UIContentContainer
UITraitEnvironment
traitCollection
traitCollectionDidChange
UIView
UIViewController
UIPresentationController
UIContentContainer
viewWillTransitionToSize
willTransitionToTraitCollection
UIViewController
UIPresentationController
Different Use Cases
Responding To Changes
Multitasking Order
•applicationWillResignActive
•willTransitionToTraitCollection
•viewWillTransitionToSize
•traitCollectionDidChange
•applicationDidBecomeActive
Multitasking Order
•applicationWillResignActive
•willTransitionToTraitCollection
•viewWillTransitionToSize
•traitCollectionDidChange
•applicationDidBecomeActive
Multitasking Order
•applicationWillResignActive
•willTransitionToTraitCollection
•viewWillTransitionToSize
•traitCollectionDidChange
•applicationDidBecomeActive
Multitasking Order
Slideovers Are Still Inactive
Becoming Adaptive
Tools
Installed Views

Installed Constraints

Conditional Constraint Constants
Demo
Only Constraint Constants
Can Change
Tips, Tricks,
Gotchas
Autolayout
Rotation APIs
UISplitViewController
Compact == Modal
Still Can’t Be Pushed
Can Be Embedded
UIPopoverPresentationController
Also Fullscreen In Compact
UIPresentationController
Set modalPresentationStyle
To .Custom
adaptivePresentationStyleFor

TraitCollection:
UICollectionView
Don’t rely on
shouldInvalidateLayoutForBoundsChange
prepareLayout()
may have incorrect traits
use both
willTransitionToTraitCollection,
viewWillTransitionToSize
Bugs!
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
iPad iPhone 6/6+ iPad Pro
iOS 5 iOS 7
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
iPad iPhone 6/6+ iPad Pro
UIViewController
iOS 5 iOS 7
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
UISplitViewController
iPad iPhone 6/6+ iPad Pro
UIViewController
UIPopoverController
iOS 5 iOS 7
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
UISplitViewController
iPad iPhone 6/6+ iPad Pro
UIViewController
UIPopoverController
UIViewController Containment
iOS 5 iOS 7
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
UISplitViewController
Autolayout
iPad iPhone 6/6+ iPad Pro
UICollectionView
UIViewController
UIPopoverController
UIViewController Containment
iOS 5 iOS 7
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
UISplitViewController
Autolayout
iPad iPhone 6/6+ iPad Pro
UICollectionView
UIViewController
UIPopoverController UITraitCollection
UITraitEnvironment
UIViewController Containment
iOS 5 iOS 7
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
UISplitViewController
Autolayout
iPad iPhone 6/6+ iPad Pro
UICollectionView
UIViewController
UIPopoverController
UIContentContainer
UITraitCollection
UITraitEnvironment
UIViewController Containment
iOS 5 iOS 7
iPhone 2 NowiPhone 3.2 iOS 6
iPhone 5
iOS 9iOS 8
UISplitViewController
Autolayout
iPad iPhone 6/6+ iPad Pro
Multitasking
UICollectionView
UIViewController
UIPopoverController
UIStackView
UIContentContainer
UITraitCollection
UITraitEnvironment
UIViewController Containment
iOS 5 iOS 7
UITraitCollection Support
Has Been Added To
Older Components
Storyboards and Xibs
Frames Change When
Size Class Changes
First Time In A New Size Class
Adds Info To File
Misplaced Views In
Different Size Classes
Installed Views And Constraints Only
Work From Storyboards And Xibs
Conditional Constraint Constants Only
Work From Storyboards And Xibs
Any x Any
Constraints Must Be Set
For Any x Any
Even though no devices have that 

size class configuration
Pick A Size Class To Use
For Any x Any
Interface Builder Warnings
UI Will Look Weird
Use Constraint Priorities
Questions?
https://github.com/mtitolo/space

https://github.com/mtitolo/primaries
Photo Credits
• https://unsplash.com/photos/iiaXf9xmgbM

• https://unsplash.com/photos/85hdWh8KtR4

• https://unsplash.com/photos/l5Tzv1alcps

More Related Content

Viewers also liked

Multitasking presentation
Multitasking presentationMultitasking presentation
Multitasking presentation
junjunjnd
 
Multitasking task engagement
Multitasking task engagementMultitasking task engagement
Multitasking task engagement
alex_xzy
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
prakrutijsh
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
Himanshu Ghetia
 

Viewers also liked (20)

Multitasking
MultitaskingMultitasking
Multitasking
 
Multitasking presentation
Multitasking presentationMultitasking presentation
Multitasking presentation
 
Multi tasking ppt
Multi tasking pptMulti tasking ppt
Multi tasking ppt
 
Multitasking
MultitaskingMultitasking
Multitasking
 
Multitasking task engagement
Multitasking task engagementMultitasking task engagement
Multitasking task engagement
 
Operating system; Multitasking
Operating system; MultitaskingOperating system; Multitasking
Operating system; Multitasking
 
Multitasking
MultitaskingMultitasking
Multitasking
 
Intro to Multitasking
Intro to MultitaskingIntro to Multitasking
Intro to Multitasking
 
Multitasking: How brain works on different tasks
Multitasking: How brain works on different tasksMultitasking: How brain works on different tasks
Multitasking: How brain works on different tasks
 
Operating System
Operating SystemOperating System
Operating System
 
Mobile and Tablet TV Multitasking - Razorfish and Yahoo!
Mobile and Tablet TV Multitasking - Razorfish and Yahoo!Mobile and Tablet TV Multitasking - Razorfish and Yahoo!
Mobile and Tablet TV Multitasking - Razorfish and Yahoo!
 
Multitasking 101
Multitasking 101Multitasking 101
Multitasking 101
 
Work force-optimization-through-multi-skilled-workers
Work force-optimization-through-multi-skilled-workersWork force-optimization-through-multi-skilled-workers
Work force-optimization-through-multi-skilled-workers
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
 
Multitasking: Maximum Effectiveness, Minimum Errors.
Multitasking: Maximum Effectiveness, Minimum Errors.Multitasking: Maximum Effectiveness, Minimum Errors.
Multitasking: Maximum Effectiveness, Minimum Errors.
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
Multitasking group ppt
Multitasking group pptMultitasking group ppt
Multitasking group ppt
 
RTOS Basic Concepts
RTOS Basic ConceptsRTOS Basic Concepts
RTOS Basic Concepts
 
Unit 4 Real Time Operating System
Unit 4 Real Time Operating SystemUnit 4 Real Time Operating System
Unit 4 Real Time Operating System
 

Similar to Multitasking

iOS humaninterfaceguidelines
iOS humaninterfaceguidelinesiOS humaninterfaceguidelines
iOS humaninterfaceguidelines
cdsg
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
Imam Raza
 
Android wear and Cardboard
Android wear and CardboardAndroid wear and Cardboard
Android wear and Cardboard
mharkus
 

Similar to Multitasking (20)

There is no spoon - iPhone vs. iPad
There is no spoon - iPhone vs. iPadThere is no spoon - iPhone vs. iPad
There is no spoon - iPhone vs. iPad
 
Titanium appcelerator sdk
Titanium appcelerator sdkTitanium appcelerator sdk
Titanium appcelerator sdk
 
iOS 8時代のUISplitViewController
iOS 8時代のUISplitViewControlleriOS 8時代のUISplitViewController
iOS 8時代のUISplitViewController
 
Compose In Practice
Compose In PracticeCompose In Practice
Compose In Practice
 
iOS humaninterfaceguidelines
iOS humaninterfaceguidelinesiOS humaninterfaceguidelines
iOS humaninterfaceguidelines
 
Iphone app programming guide
Iphone app programming guideIphone app programming guide
Iphone app programming guide
 
Mobile hig
Mobile higMobile hig
Mobile hig
 
Android Wear: A Developer's Perspective
Android Wear: A Developer's PerspectiveAndroid Wear: A Developer's Perspective
Android Wear: A Developer's Perspective
 
Unos minutos con WatchKit - iCon
Unos minutos con WatchKit - iConUnos minutos con WatchKit - iCon
Unos minutos con WatchKit - iCon
 
Everything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesEverything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable Phones
 
Are You Ready for iOS 8?
Are You Ready for iOS 8?Are You Ready for iOS 8?
Are You Ready for iOS 8?
 
Google Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talkGoogle Developer Group(GDG) DevFest Event 2012 Android talk
Google Developer Group(GDG) DevFest Event 2012 Android talk
 
打造你的第一個iPhone APP
打造你的第一個iPhone APP打造你的第一個iPhone APP
打造你的第一個iPhone APP
 
Win8 development lessons learned jayway
Win8 development lessons learned jaywayWin8 development lessons learned jayway
Win8 development lessons learned jayway
 
Android wear and Cardboard
Android wear and CardboardAndroid wear and Cardboard
Android wear and Cardboard
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Mobile hig
Mobile higMobile hig
Mobile hig
 
An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)An end-to-end experience of Windows Phone 7 development (Part 1)
An end-to-end experience of Windows Phone 7 development (Part 1)
 
Web app
Web appWeb app
Web app
 
Web app
Web appWeb app
Web app
 

More from Michele Titolo

Mastering the Project File (AltConf)
Mastering the Project File (AltConf)Mastering the Project File (AltConf)
Mastering the Project File (AltConf)
Michele Titolo
 

More from Michele Titolo (20)

Writing Design Docs for Wide Audiences
Writing Design Docs for Wide AudiencesWriting Design Docs for Wide Audiences
Writing Design Docs for Wide Audiences
 
Beam Me Up: Voyaging into Big Data
Beam Me Up: Voyaging into Big DataBeam Me Up: Voyaging into Big Data
Beam Me Up: Voyaging into Big Data
 
APIs: The Good, The Bad, The Ugly
APIs: The Good, The Bad, The UglyAPIs: The Good, The Bad, The Ugly
APIs: The Good, The Bad, The Ugly
 
Tackling the Big, Impossible Project
Tackling the Big, Impossible ProjectTackling the Big, Impossible Project
Tackling the Big, Impossible Project
 
No Microservice is an Island
No Microservice is an IslandNo Microservice is an Island
No Microservice is an Island
 
From iOS to Distributed Systems
From iOS to Distributed SystemsFrom iOS to Distributed Systems
From iOS to Distributed Systems
 
More than po: Debugging in LLDB
More than po: Debugging in LLDBMore than po: Debugging in LLDB
More than po: Debugging in LLDB
 
APIs for the Mobile World
APIs for the Mobile WorldAPIs for the Mobile World
APIs for the Mobile World
 
Swift Generics in Theory and Practice
Swift Generics in Theory and PracticeSwift Generics in Theory and Practice
Swift Generics in Theory and Practice
 
Protocols promised-land-2
Protocols promised-land-2Protocols promised-land-2
Protocols promised-land-2
 
Making friendly-microservices
Making friendly-microservicesMaking friendly-microservices
Making friendly-microservices
 
More Than po: Debugging in LLDB @ CocoaConf SJ 2015
More Than po: Debugging in LLDB @ CocoaConf SJ 2015More Than po: Debugging in LLDB @ CocoaConf SJ 2015
More Than po: Debugging in LLDB @ CocoaConf SJ 2015
 
The Worst Code
The Worst CodeThe Worst Code
The Worst Code
 
More than `po`: Debugging in lldb
More than `po`: Debugging in lldbMore than `po`: Debugging in lldb
More than `po`: Debugging in lldb
 
Can't Handle My Scale v2
Can't Handle My Scale v2Can't Handle My Scale v2
Can't Handle My Scale v2
 
Can't Handle My Scale
Can't Handle My ScaleCan't Handle My Scale
Can't Handle My Scale
 
Cocoa Design Patterns in Swift
Cocoa Design Patterns in SwiftCocoa Design Patterns in Swift
Cocoa Design Patterns in Swift
 
Mastering the Project File (AltConf)
Mastering the Project File (AltConf)Mastering the Project File (AltConf)
Mastering the Project File (AltConf)
 
APIs: The Ugly
APIs: The UglyAPIs: The Ugly
APIs: The Ugly
 
That's Not My Code!
That's Not My Code!That's Not My Code!
That's Not My Code!
 

Recently uploaded

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

Multitasking