The document discusses the new features introduced in iOS 4, including multitasking, local notifications, iAd, Game Center, and new frameworks and APIs. It focuses on multitasking, explaining how apps can run in the background to perform tasks, play audio, use location services and more. It provides details on the app lifecycle and how apps should handle transitions between active, inactive and background states to be efficient and prevent termination.
7. SkillsMatter - August 12th 2010
Multitasking
Fast app switching
Task Completion
Background Audio
Navigation & Location tracking
VoIP
http://pardel.net
8. SkillsMatter - August 12th 2010
Fast App Switching
Running
Not running
http://pardel.net
9. SkillsMatter - August 12th 2010
Fast App Switching
Active
Running
Inactive
Not running
http://pardel.net
10. SkillsMatter - August 12th 2010
Fast App Switching
Active
Running Running
Inactive
Background
Not running Not running
http://pardel.net
11. SkillsMatter - August 12th 2010
Fast App Switching
Active
Running Running
Inactive
Running
Background
Suspended
Not running Not running
http://pardel.net
12. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Not running http://pardel.net
13. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
Inactive
Not running http://pardel.net
14. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
Inactive
Not running http://pardel.net
15. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
Not running http://pardel.net
16. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Not running http://pardel.net
17. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Not running http://pardel.net
18. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Not running http://pardel.net
19. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Background
Running
Suspended
Not running http://pardel.net
20. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
applicationDidResignActive:
Background
Running
Suspended
Not running http://pardel.net
21. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Background applicationDidEnterBackground:
Running
Suspended
Not running http://pardel.net
22. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Background applicationDidEnterBackground:
Running
applicationDidEnterForeground:
Suspended
Not running http://pardel.net
23. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Background applicationDidEnterBackground:
Running
applicationDidEnterForeground:
Suspended
Not running http://pardel.net
24. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Background applicationDidEnterBackground:
Running
applicationDidEnterForeground:
Suspended
Not running http://pardel.net
25. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationDidResignActive:
Inactive
applicationDidTerminate:
Background applicationDidEnterBackground:
Running
applicationDidEnterForeground:
Suspended
Not running http://pardel.net
29. SkillsMatter - August 12th 2010
Best practices
Active
Foreground
Inactive applicationDidEnterForeground:
Background applicationDidEnterBackground:
Running
Suspended
Not running http://pardel.net
30. SkillsMatter - August 12th 2010
Best practices
Active
Foreground
Inactive applicationDidEnterForeground:
Background applicationDidEnterBackground:
Running ✦ save state
✦ minimise memory usage
✦ change the UI accordingly
✦ stop Bonjour & networking
✦ stop shared system data
Suspended access & GPU
Not running http://pardel.net
31. SkillsMatter - August 12th 2010
Best practices
Active
Foreground
Inactive applicationDidEnterForeground:
Background applicationDidEnterBackground:
Running ✦ save state
✦ minimise memory usage
✦ change the UI accordingly
✦ stop Bonjour & networking
✦ stop shared system data
Suspended access & GPU
your app can be
Not running terminated at any time
http://pardel.net
32. SkillsMatter - August 12th 2010
No Multitasking
UIApplicationExitsOnSuspend
http://pardel.net
33. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Background
Running
Suspended
Not running http://pardel.net
34. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Background
Running
Suspended
Not running http://pardel.net
35. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Background
Running
Suspended
Not running http://pardel.net
36. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Background
Running applicationDidEnterBackground:
Suspended
Not running http://pardel.net
37. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Background
Running applicationDidEnterBackground:
applicationDidTerminate:
Suspended
Not running http://pardel.net
38. SkillsMatter - August 12th 2010
Background Services
Task completion
Background Audio
VoIP
Background Location
http://pardel.net
39. SkillsMatter - August 12th 2010
Task completion
Active
Foreground
Inactive
Background
Not running
http://pardel.net
40. SkillsMatter - August 12th 2010
Task completion
Active
Foreground
Inactive
Background
Running
Not running
http://pardel.net
41. SkillsMatter - August 12th 2010
Task completion
Active
Foreground
Inactive
Background
Running
Not running
http://pardel.net
42. SkillsMatter - August 12th 2010
Task completion
Active
Foreground
Inactive
Background
Running
Suspended
Not running
http://pardel.net
43. SkillsMatter - August 12th 2010
Task completion
Active
Foreground
Inactive
Background
Running
Not running
http://pardel.net
49. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Background
Not running
http://pardel.net
50. SkillsMatter - August 12th 2010
App Life Cycle
Active
Foreground
Inactive
Background
Running
Not running
http://pardel.net
51. SkillsMatter - August 12th 2010
App Life Cycle
AVAudioSession
Active
Foreground
Inactive AVAudioSessionDelegate
Background
Running
Not running
http://pardel.net
52. SkillsMatter - August 12th 2010
App Life Cycle
AVAudioSession
Active
Foreground
Inactive AVAudioSessionDelegate
Background
Running
Not running
http://pardel.net
53. SkillsMatter - August 12th 2010
App Life Cycle
AVAudioSession
Active
Foreground
Inactive AVAudioSessionDelegate
beginInteruption
Background
Running
Suspended
Not running
http://pardel.net
54. SkillsMatter - August 12th 2010
App Life Cycle
AVAudioSession
Active
Foreground
Inactive AVAudioSessionDelegate
beginInteruption
Background
Running
Suspended
Not running
http://pardel.net
55. SkillsMatter - August 12th 2010
App Life Cycle
AVAudioSession
Active
Foreground
endInteruption
Inactive AVAudioSessionDelegate
beginInteruption
Background
Running Running
Suspended
Not running
http://pardel.net
56. SkillsMatter - August 12th 2010
App Life Cycle
AVAudioSession
Active
Foreground
Inactive AVAudioSessionDelegate
beginInteruption endInterruptionWithFlags:
Background
Running Running
Suspended
Not running
http://pardel.net
57. SkillsMatter - August 12th 2010
Background Location Services
Turn by turn directions
Location tracking
✦ Significant location changing
✦ Region monitoring (iPhone4 only)
http://pardel.net
60. SkillsMatter - August 12th 2010
Turn by turn directions
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
[locationManager startUpdatingLocation];
extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation;
extern const CLLocationAccuracy kCLLocationAccuracyBest;
extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters;
extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters;
extern const CLLocationAccuracy kCLLocationAccuracyKilometer;
extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers;
kCLLocationAccuracyBestForNavigation
Use the highest possible accuracy and combine it with additional sensor data. This level of
accuracy is intended for use in navigation applications that require precise position
information at all times and are intended to be used only while the device is plugged in.
http://pardel.net
61. SkillsMatter - August 12th 2010
Location tracking
a) Significant location changing
http://pardel.net
62. SkillsMatter - August 12th 2010
Location tracking
a) Significant location changing
http://pardel.net
63. SkillsMatter - August 12th 2010
Location tracking
a) Significant location changing
http://pardel.net
64. SkillsMatter - August 12th 2010
Location tracking
a) Significant location changing
http://pardel.net
77. SkillsMatter - August 12th 2010
iAd
Nov 09 - Google acquires AdMob for $750 million in
stock
Jan 10 - Apple acquires Quattro Wireless for $275
million
http://pardel.net
94. SkillsMatter - August 12th 2010
Block Objects
self.bgTaskId = [app beginBackgroundTaskWithExpirationHandler:^{
[self stopLongTask];
}];
an object with some code
respond to NSObject methods
available in C
http://pardel.net
106. SkillsMatter - August 12th 2010
New API’s
Block related methods
- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))
block
Photo Library Access
MapKit improvements
http://pardel.net
107. SkillsMatter - August 12th 2010
iPhone & iPad Application
Development Course
Sep 29th to Oct 1st
http://skillsmatter.com/course/os-mobile-server/
iphone-ipad-application-development
http://pardel.net
108. SkillsMatter - August 12th 2010
iPhone & iPad Application
Development Course
Sep 29th to Oct 1st
http://skillsmatter.com/course/os-mobile-server/
iphone-ipad-application-development
http://pardel.net
109. SkillsMatter - August 12th 2010
PROGRAMME
Day 1: Introduction to iOS development I Day 3: Advance Features I
•
The development environment
•
Touch & Gestures
•
Objective C crash course
•
Camera & Photo Library access
•
Foundation framework
•
Core Location
•
Memory management
•
Event Kit
•
The iPhone Dev Center
•
Core Motion
•
Web Services (inc. XML & JSON Parsers)
•
Threading
•
Localisation
Day 2: Introduction to iOS development II Day 4: Advance Features II
•
Design patterns (MVC, Delegation, etc.)
•
Documents Sharing
•
Table views, Navigation, Tab bar
•
Multitasking
•
Data Persistence (Preferences, SQLite &
•
Local notifications
Code Data)
•
iPad Specific topics
•
Animation
•
Testing and Optimisation (Instruments)
•
Core Graphics
•
Submitting your application to the App Store
http://pardel.net
110. SkillsMatter - August 12th 2010
Thank you
http://pardel.net
http://twitter.com/pardel
http://pardel.net