in the brain of paul ardeleanu: what's new in ios 4

110
What’s new in iOS4 Paul Ardeleanu @pardel SkillsMatter - August 12th 2010

Upload: paul-ardeleanu

Post on 15-Jan-2015

2.734 views

Category:

Technology


0 download

DESCRIPTION

Skills Matter Presentation: "What's new in iOS 4"

TRANSCRIPT

Page 1: In The Brain of Paul Ardeleanu: What's new in iOS 4

What’s new in iOS4Paul Ardeleanu

@pardel

SkillsMatter - August 12th 2010

Page 2: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

What was missing?

Multitasking

Flash

Page 3: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

What’s new in iOS4?

Multitasking

Local Notifications

iAd

Game Center

New Frameworks & APIs

Page 4: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

1. Multitasking

Page 5: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

1. Multitasking ... of a different kind

Page 6: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Multitasking

Page 7: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Multitasking

Fast app switching

Task Completion

Background Audio

Navigation & Location tracking

VoIP

Page 8: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Fast App Switching

Running

Not running

Page 9: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Fast App Switching

Running

Not running

Active

Inactive

Page 10: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Fast App Switching

Running

Not running

Running

Not running

Background

Active

Inactive

Page 11: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Fast App Switching

Running

Not running

Running

Not running

Background

Active

Inactive

Running

Suspended

Page 12: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Not running

Page 13: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Not running

didFinishLaunchingWithOptions:

Page 14: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

Page 15: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

Page 16: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

Page 17: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

Page 18: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

Page 19: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

Page 20: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

applicationDidResignActive:

Page 21: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

applicationDidEnterBackground:

Page 22: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

applicationDidEnterBackground:

applicationDidEnterForeground:

Page 23: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

applicationDidEnterBackground:

applicationDidEnterForeground:

Page 24: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

applicationDidEnterBackground:

applicationDidEnterForeground:

Page 25: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

didFinishLaunchingWithOptions:

applicationDidBecomeActive:

applicationDidResignActive:

applicationDidTerminate:

applicationDidEnterBackground:

applicationDidEnterForeground:

Page 26: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

UIApplicationDelegate Callbacks

//// MyAppDelegate.m//

- (void)applicationWillResignActive:(UIApplication *)application

- (void)applicationDidEnterBackground:(UIApplication *)application

- (void)applicationWillEnterForeground:(UIApplication *)application

- (void)applicationDidBecomeActive:(UIApplication *)application

- (void)applicationWillTerminate:(UIApplication *)application

UIApplicationDidEnterBackgroundNotificationUIApplicationDidEnterForegroundNotification

Page 27: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

UIApplicationDelegate Callbacks

//// MyAppDelegate.m//

- (void)applicationWillResignActive:(UIApplication *)application

- (void)applicationDidEnterBackground:(UIApplication *)application

- (void)applicationWillEnterForeground:(UIApplication *)application

- (void)applicationDidBecomeActive:(UIApplication *)application

- (void)applicationWillTerminate:(UIApplication *)application

Demo

UIApplicationDidEnterBackgroundNotificationUIApplicationDidEnterForegroundNotification

Page 28: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

UIApplicationtypedef enum { UIApplicationStateActive, UIApplicationStateInactive, UIApplicationStateBackground} UIApplicationState;

@property(nonatomic,readonly) UIApplicationState applicationState

[[UIApplication sharedApplication] applicationState]

Page 29: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Best practicesForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

applicationDidEnterBackground:

applicationDidEnterForeground:

Page 30: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Best practicesForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

applicationDidEnterBackground:

applicationDidEnterForeground:

✦ save state✦ minimise memory usage✦ change the UI accordingly✦ stop Bonjour & networking✦ stop shared system data

access & GPU

Page 31: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Best practicesForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

applicationDidEnterBackground:

applicationDidEnterForeground:

✦ save state✦ minimise memory usage✦ change the UI accordingly✦ stop Bonjour & networking✦ stop shared system data

access & GPU

your app can be terminated at any time

Page 32: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

No Multitasking

UIApplicationExitsOnSuspend

Page 33: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

Page 34: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

Page 35: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

Page 36: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

applicationDidEnterBackground:

Page 37: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

applicationDidEnterBackground:

applicationDidTerminate:

Page 38: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Background Services

Task completion

Background Audio

VoIP

Background Location

Page 39: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completionForegroundActive

Inactive

Background

Not running

Page 40: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completionForegroundActive

Inactive

BackgroundRunning

Not running

Page 41: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completionForegroundActive

Inactive

BackgroundRunning

Not running

Page 42: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completionForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

Page 43: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completionForegroundActive

Inactive

BackgroundRunning

Not running

Page 44: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completionUIApplication

- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void(^)(void))handler;- (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier;

@property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining;

Page 45: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completionUIApplication

typedef NSUInteger UIBackgroundTaskIdentifier;

- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void(^)(void))handler;- (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier;

@property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining;

Page 46: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Task completion

self.bgTaskId = [app beginBackgroundTaskWithExpirationHandler: ^{ [self stopLongTask];}];...[[UIApplication sharedApplication] endBackgroundTask:self.bgTaskId];

UIApplication

typedef NSUInteger UIBackgroundTaskIdentifier;

- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void(^)(void))handler;- (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier;

@property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining;

Page 47: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Background Services

Task completion

Background Audio

VoIP

Background Location

Page 48: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Background Services

Page 49: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

Background

Not running

Page 50: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Not running

Page 51: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Not running

AVAudioSession

AVAudioSessionDelegate

Page 52: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Not running

AVAudioSession

AVAudioSessionDelegate

Page 53: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

beginInteruption

AVAudioSession

AVAudioSessionDelegate

Page 54: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

beginInteruption

AVAudioSession

AVAudioSessionDelegate

Page 55: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

Running

beginInteruption

AVAudioSession

AVAudioSessionDelegate

endInteruption

Page 56: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

App Life CycleForegroundActive

Inactive

BackgroundRunning

Suspended

Not running

Running

beginInteruption

AVAudioSession

AVAudioSessionDelegate

endInterruptionWithFlags:

Page 57: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Background Location Services

Turn by turn directions

Location tracking✦ Significant location changing✦ Region monitoring (iPhone4 only)

Page 58: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Turn by turn directions

locationManager = [[CLLocationManager alloc] init];locationManager.delegate = self;locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;[locationManager startUpdatingLocation];

Page 59: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

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;

Page 60: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Turn by turn directions

kCLLocationAccuracyBestForNavigationUse 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.

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;

Page 61: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

a) Significant location changing

Page 62: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

a) Significant location changing

Page 63: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

a) Significant location changing

Page 64: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

a) Significant location changing

Page 65: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

a) Significant location changing

locationManager = [[CLLocationManager alloc] init];locationManager.delegate = self;[locationManager startMonitoringSignificantLocationChanges];

Page 66: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

a) Significant location changing

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation

locationManager = [[CLLocationManager alloc] init];locationManager.delegate = self;[locationManager startMonitoringSignificantLocationChanges];

Page 67: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

b) Region monitoring (iPhone4 only)

Page 68: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

b) Region monitoring (iPhone4 only)

Page 69: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

b) Region monitoring (iPhone4 only)

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation

Page 70: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Location tracking

b) Region monitoring (iPhone4 only)

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation

locationManager = [[CLLocationManager alloc] init];locationManager.delegate = self;locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;CLLocationCoordinate2D regionCenterCoordinate;tempCoordinate.latitude = 51.5245;tempCoordinate.longitude = -0.0995;

CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:regionCenterCoordinate radius:10.0 identifier:@"Skills Matter"];[locationManager startMonitoringForRegion:region desiredAccuracy:kCLLocationAccuracyNearestTenMeters];

Page 71: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Multitasking

Page 72: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Multitasking

Fast app switching

Task Completion

Background Audio

Navigation & Location tracking

VoIP

Page 73: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

2. Local Notifications

Page 74: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Local notifications// check if the local notification class exists Class cls = NSClassFromString(@"UILocalNotification");if (cls != nil) {

// check if the device is supporting multitasking UIDevice* device = [UIDevice currentDevice]; if ([device respondsToSelector:@selector(isMultitaskingSupported)]) { UIApplication* app = [UIApplication sharedApplication]; UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease]; if (alarm) { alarm.fireDate = [NSDate date]; alarm.timeZone = [NSTimeZone defaultTimeZone]; alarm.repeatInterval = 0; alarm.soundName = @"alert.caf"; alarm.alertBody = @"Ha ha"; [app scheduleLocalNotification:alarm]; } }

}

Page 75: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Local notifications// check if the local notification class exists Class cls = NSClassFromString(@"UILocalNotification");if (cls != nil) {

// check if the device is supporting multitasking UIDevice* device = [UIDevice currentDevice]; if ([device respondsToSelector:@selector(isMultitaskingSupported)]) { UIApplication* app = [UIApplication sharedApplication]; UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease]; if (alarm) { alarm.fireDate = [NSDate date]; alarm.timeZone = [NSTimeZone defaultTimeZone]; alarm.repeatInterval = 0; alarm.soundName = @"alert.caf"; alarm.alertBody = @"Ha ha"; [app scheduleLocalNotification:alarm]; } }

}

Demo

Page 76: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

3. iAd

Page 77: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd

Nov 09 - Google acquires AdMob for $750 million in stock

Jan 10 - Apple acquires Quattro Wireless for $275 million

Page 78: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd

CPM + CPC = eCPM

Page 79: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd

CPM + CPC = eCPM

Page 80: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd

CPM + CPC = eCPM

60% revenues

Page 81: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd

Page 82: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd.frameworkADBannerView

@property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;@property (nonatomic, copy) NSString *currentContentSizeIdentifier;

@property(nonatomic, readonly) BOOL bannerLoaded;@property(nonatomic, readonly) BOOL bannerViewActionInProgress;

- (void)cancelBannerViewAction;

@property(nonatomic, assign) id<ADBannerViewDelegate> delegate;

Page 83: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd.frameworkADBannerView

@property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;@property (nonatomic, copy) NSString *currentContentSizeIdentifier;

@property(nonatomic, readonly) BOOL bannerLoaded;@property(nonatomic, readonly) BOOL bannerViewActionInProgress;

- (void)cancelBannerViewAction;

@property(nonatomic, assign) id<ADBannerViewDelegate> delegate;

Page 84: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd.frameworkADBannerView

@property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;@property (nonatomic, copy) NSString *currentContentSizeIdentifier;

@property(nonatomic, readonly) BOOL bannerLoaded;@property(nonatomic, readonly) BOOL bannerViewActionInProgress;

- (void)cancelBannerViewAction;

@property(nonatomic, assign) id<ADBannerViewDelegate> delegate;

Page 85: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd.frameworkADBannerView

ADBannerContentSizeIdentifier320x50ADBannerContentSizeIdentifier480x32

@property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;@property (nonatomic, copy) NSString *currentContentSizeIdentifier;

@property(nonatomic, readonly) BOOL bannerLoaded;@property(nonatomic, readonly) BOOL bannerViewActionInProgress;

- (void)cancelBannerViewAction;

@property(nonatomic, assign) id<ADBannerViewDelegate> delegate;

Page 86: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd.framework

ADBannerViewDelegate

ADBannerView

- (void)bannerViewDidLoadAd:(ADBannerView *)banner;

- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave;- (void)bannerViewActionDidFinish:(ADBannerView *)banner;

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error;

Page 87: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd.framework

ADBannerViewDelegate

Demo

ADBannerView

- (void)bannerViewDidLoadAd:(ADBannerView *)banner;

- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave;- (void)bannerViewActionDidFinish:(ADBannerView *)banner;

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error;

Page 88: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

iAd JS

✦ Banner✦ Main advertising screen

HTML5 + CSS3

Page 89: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

4. Game Center

Page 90: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Game Center

✦ Beta✦ Social gaming network✦ Leaderboards & Achievements

Page 91: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

5. New Frameworks & APIs

Page 92: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Block Objects

Page 93: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Block Objectsself.bgTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ [self stopLongTask];}];

Page 94: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Block Objectsself.bgTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ [self stopLongTask];}];

an object with some code

respond to NSObject methods

available in C

Page 95: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Blocks

Page 96: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Blocks

returnType (^myBlockName) (argumentType) = ^(argumentType argumentName){ returnType x; ... return x;}

Page 97: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Blocks

returnType (^myBlockName) (argumentType) = ^(argumentType argumentName){ returnType x; ... return x;}

int (^myBlock) (int) = ^(int num) { return num * multiplier; }

Page 98: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Blocks

returnType (^myBlockName) (argumentType) = ^(argumentType argumentName){ returnType x; ... return x;}

int (^myBlock) (int) = ^(int num) { return num * multiplier; }

int multiplier = 5;

Page 99: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Blocks

returnType (^myBlockName) (argumentType) = ^(argumentType argumentName){ returnType x; ... return x;}

int (^myBlock) (int) = ^(int num) { return num * multiplier; }

int multiplier = 5;

myBlock(7);

Page 100: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

New Frameworks

Quick Look

Event Kit

Core Motion

Core Telephony

Data Protection

Page 101: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Event Kit

Page 102: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Event Kit

EKEventStore@property(nonatomic, readonly) NSArray *calendars@property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents

Page 103: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Event Kit

EKEventStore@property(nonatomic, readonly) NSArray *calendars@property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents

EKCalendar

Page 104: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Event Kit

EKEventStore@property(nonatomic, readonly) NSArray *calendars@property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents

EKCalendartypedef enum { EKCalendarTypeLocal, EKCalendarTypeCalDAV, EKCalendarTypeExchange, EKCalendarTypeSubscription, EKCalendarTypeBirthday,} EKCalendarType;

Page 105: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Event Kit

EKEventStore@property(nonatomic, readonly) NSArray *calendars@property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents

EKCalendar EKEventtypedef enum { EKCalendarTypeLocal, EKCalendarTypeCalDAV, EKCalendarTypeExchange, EKCalendarTypeSubscription, EKCalendarTypeBirthday,} EKCalendarType;

alarms -> EKAlarmorganizer, attendees -> EKParticipantrecurrenceRule -> EKRecurrenceRule

Page 106: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

New API’s

Block related methods

- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block

Photo Library Access

MapKit improvements

Page 109: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

PROGRAMME

Day 1: Introduction to iOS development I • The development environment • Objective C crash course • Foundation framework • Memory management • The iPhone Dev Center

Day 3: Advance Features I • Touch & Gestures • Camera & Photo Library access • Core Location • Event Kit • Core Motion • Web Services (inc. XML & JSON Parsers) • Threading • Localisation

Day 2: Introduction to iOS development II • Design patterns (MVC, Delegation, etc.) • Table views, Navigation, Tab bar • Data Persistence (Preferences, SQLite & Code Data) • Animation • Core Graphics

Day 4: Advance Features II • Documents Sharing • Multitasking • Local notifications • iPad Specific topics • Testing and Optimisation (Instruments) • Submitting your application to the App Store

Page 110: In The Brain of Paul Ardeleanu: What's new in iOS 4

SkillsMatter - August 12th 2010

http://pardel.net

Thank you

http://pardel.nethttp://twitter.com/pardel