SlideShare uma empresa Scribd logo
1 de 110
Baixar para ler offline
What’s new in iOS4
    Paul Ardeleanu
       @pardel




                     SkillsMatter - August 12th 2010
SkillsMatter - August 12th 2010




What was missing?

Multitasking
Flash




                                   http://pardel.net
SkillsMatter - August 12th 2010




What’s new in iOS4?

Multitasking
Local Notifications
iAd
Game Center
New Frameworks & APIs



                                       http://pardel.net
SkillsMatter - August 12th 2010




1. Multitasking



                                 http://pardel.net
SkillsMatter - August 12th 2010




1. Multitasking   ... of a different kind




                                                 http://pardel.net
SkillsMatter - August 12th 2010




Multitasking




                              http://pardel.net
SkillsMatter - August 12th 2010




Multitasking

 Fast app switching
 Task Completion
 Background Audio
 Navigation & Location tracking
 VoIP



                                                 http://pardel.net
SkillsMatter - August 12th 2010




Fast App Switching

    Running




    Not running


                                    http://pardel.net
SkillsMatter - August 12th 2010




Fast App Switching
                  Active
    Running
                  Inactive




    Not running


                                            http://pardel.net
SkillsMatter - August 12th 2010




Fast App Switching
                  Active
    Running                  Running
                  Inactive




                             Background




    Not running              Not running


                                                     http://pardel.net
SkillsMatter - August 12th 2010




Fast App Switching
                   Active
    Running                   Running
                   Inactive




                   Running
                              Background
                  Suspended




    Not running               Not running


                                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground



     Inactive




         Not running                               http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:




     Inactive




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:


     Inactive




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




                       Background
           Running



          Suspended




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




                                    applicationDidResignActive:
                       Background
           Running



          Suspended




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




                       Background   applicationDidEnterBackground:
           Running



          Suspended




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




                       Background   applicationDidEnterBackground:
           Running
                                    applicationDidEnterForeground:



          Suspended




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




                       Background   applicationDidEnterBackground:
           Running
                                    applicationDidEnterForeground:



          Suspended




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




                       Background   applicationDidEnterBackground:
           Running
                                    applicationDidEnterForeground:



          Suspended




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground   didFinishLaunchingWithOptions:


                                    applicationDidBecomeActive:
                                    applicationDidResignActive:

     Inactive
                                    applicationDidTerminate:




                       Background   applicationDidEnterBackground:
           Running
                                    applicationDidEnterForeground:



          Suspended




         Not running                                      http://pardel.net
SkillsMatter - August 12th 2010




UIApplicationDelegate Callbacks
     //
     //   MyAppDelegate.m
     //


     - (void)applicationWillResignActive:(UIApplication *)application

     - (void)applicationDidEnterBackground:(UIApplication *)application




     - (void)applicationWillEnterForeground:(UIApplication *)application

     - (void)applicationDidBecomeActive:(UIApplication *)application


     - (void)applicationWillTerminate:(UIApplication *)application




                UIApplicationDidEnterBackgroundNotification
                UIApplicationDidEnterForegroundNotification


                                                                                       http://pardel.net
SkillsMatter - August 12th 2010




UIApplicationDelegate Callbacks
     //
     //   MyAppDelegate.m
     //


     - (void)applicationWillResignActive:(UIApplication *)application

     - (void)applicationDidEnterBackground:(UIApplication *)application




     - (void)applicationWillEnterForeground:(UIApplication *)application

     - (void)applicationDidBecomeActive:(UIApplication *)application


     - (void)applicationWillTerminate:(UIApplication *)application




                UIApplicationDidEnterBackgroundNotification
                UIApplicationDidEnterForegroundNotification


                               Demo                                                    http://pardel.net
SkillsMatter - August 12th 2010




UIApplication
typedef enum {
	 UIApplicationStateActive,
	 UIApplicationStateInactive,
	 UIApplicationStateBackground
} UIApplicationState;




@property(nonatomic,readonly) UIApplicationState applicationState




[[UIApplication sharedApplication] applicationState]




                                                                                   http://pardel.net
SkillsMatter - August 12th 2010




Best practices
     Active
                       Foreground



     Inactive                       applicationDidEnterForeground:




                       Background   applicationDidEnterBackground:
           Running



          Suspended




         Not running                                      http://pardel.net
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
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
SkillsMatter - August 12th 2010




No Multitasking




         UIApplicationExitsOnSuspend
                                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground



     Inactive




                       Background
           Running



          Suspended




         Not running                               http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground



     Inactive




                       Background
           Running



          Suspended




         Not running                               http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground



     Inactive




                       Background
           Running



          Suspended




         Not running                               http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground



     Inactive




                       Background
           Running                  applicationDidEnterBackground:




          Suspended




         Not running                                     http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
     Active
                       Foreground



     Inactive




                       Background
           Running                  applicationDidEnterBackground:

                                    applicationDidTerminate:


          Suspended




         Not running                                     http://pardel.net
SkillsMatter - August 12th 2010




Background Services

Task completion
Background Audio
VoIP
Background Location




                                     http://pardel.net
SkillsMatter - August 12th 2010




Task completion
    Active
             Foreground



  Inactive




                               Background




                 Not running
                                               http://pardel.net
SkillsMatter - August 12th 2010




Task completion
    Active
             Foreground



  Inactive




                               Background
                    Running




                 Not running
                                               http://pardel.net
SkillsMatter - August 12th 2010




Task completion
    Active
             Foreground



  Inactive




                               Background
                    Running




                 Not running
                                               http://pardel.net
SkillsMatter - August 12th 2010




Task completion
    Active
             Foreground



  Inactive




                               Background
                    Running




                               Suspended



                 Not running
                                                 http://pardel.net
SkillsMatter - August 12th 2010




Task completion
    Active
             Foreground



  Inactive




                               Background
                    Running




                 Not running
                                               http://pardel.net
SkillsMatter - August 12th 2010




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

  @property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining;




                                                                                http://pardel.net
SkillsMatter - August 12th 2010




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

  @property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining;


  typedef NSUInteger UIBackgroundTaskIdentifier;




                                                                                http://pardel.net
SkillsMatter - August 12th 2010




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

  @property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining;


  typedef NSUInteger UIBackgroundTaskIdentifier;




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




                                                                                http://pardel.net
SkillsMatter - August 12th 2010




Background Services

Task completion
Background Audio
VoIP
Background Location




                                     http://pardel.net
SkillsMatter - August 12th 2010




Background Services




                                     http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
    Active
             Foreground



  Inactive




                               Background




                 Not running
                                               http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
    Active
             Foreground



  Inactive




                               Background
               Running




                 Not running
                                               http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
                                  AVAudioSession


    Active
             Foreground



  Inactive                     AVAudioSessionDelegate




                                         Background
               Running




                 Not running
                                                            http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
                                  AVAudioSession


    Active
             Foreground



  Inactive                     AVAudioSessionDelegate




                                         Background
               Running




                 Not running
                                                            http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
                                            AVAudioSession


    Active
             Foreground



  Inactive                               AVAudioSessionDelegate



                beginInteruption

                                                   Background
               Running




                             Suspended



                 Not running
                                                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
                                            AVAudioSession


    Active
             Foreground



  Inactive                               AVAudioSessionDelegate



                beginInteruption

                                                   Background
               Running




                             Suspended



                 Not running
                                                                      http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
                                             AVAudioSession


    Active
             Foreground

                                                            endInteruption


  Inactive                                AVAudioSessionDelegate



                beginInteruption

                                                    Background
               Running                   Running




                             Suspended



                 Not running
                                                                       http://pardel.net
SkillsMatter - August 12th 2010




App Life Cycle
                                                 AVAudioSession


    Active
             Foreground



  Inactive                                   AVAudioSessionDelegate



                beginInteruption   endInterruptionWithFlags:

                                                         Background
               Running                     Running




                             Suspended



                 Not running
                                                                              http://pardel.net
SkillsMatter - August 12th 2010




Background Location Services


Turn by turn directions

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




                                                        http://pardel.net
SkillsMatter - August 12th 2010




Turn by turn directions
 locationManager = [[CLLocationManager alloc] init];
 locationManager.delegate = self;
 locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
 [locationManager startUpdatingLocation];




                                                                                http://pardel.net
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;




                                                                                      http://pardel.net
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
SkillsMatter - August 12th 2010




Location tracking
a) Significant location changing




                                                 http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
a) Significant location changing




                                                 http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
a) Significant location changing




                                                 http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
a) Significant location changing




                                                 http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
a) Significant location changing




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




                                                                                 http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
a) Significant location changing




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




  - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:
  (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
                                                                                 http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
b) Region monitoring (iPhone4 only)




                                                     http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
b) Region monitoring (iPhone4 only)




                                                     http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
b) Region monitoring (iPhone4 only)




 - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:
 (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation                http://pardel.net
SkillsMatter - August 12th 2010




Location tracking
b) Region monitoring (iPhone4 only)
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];




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

                                                                                         http://pardel.net
SkillsMatter - August 12th 2010




Multitasking




                              http://pardel.net
SkillsMatter - August 12th 2010




Multitasking

 Fast app switching
 Task Completion
 Background Audio
 Navigation & Location tracking
 VoIP



                                                 http://pardel.net
SkillsMatter - August 12th 2010




2. Local Notifications



                                       http://pardel.net
SkillsMatter - August 12th 2010




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];
	   	    }
	   }

}




                                                                                             http://pardel.net
SkillsMatter - August 12th 2010




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                                                  http://pardel.net
SkillsMatter - August 12th 2010




3. iAd



                        http://pardel.net
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
SkillsMatter - August 12th 2010




iAd
      CPM + CPC = eCPM




                                        http://pardel.net
SkillsMatter - August 12th 2010




iAd
      CPM + CPC = eCPM




                                        http://pardel.net
SkillsMatter - August 12th 2010




iAd
      CPM + CPC = eCPM




         60% revenues
                                        http://pardel.net
SkillsMatter - August 12th 2010




iAd




                     http://pardel.net
SkillsMatter - August 12th 2010




iAd.framework
               @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;

ADBannerView   @property (nonatomic, copy) NSString *currentContentSizeIdentifier;

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

               - (void)cancelBannerViewAction;


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




                                                                                              http://pardel.net
SkillsMatter - August 12th 2010




iAd.framework
               @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;

ADBannerView   @property (nonatomic, copy) NSString *currentContentSizeIdentifier;

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

               - (void)cancelBannerViewAction;


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




                                                                                              http://pardel.net
SkillsMatter - August 12th 2010




iAd.framework
               @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;

ADBannerView   @property (nonatomic, copy) NSString *currentContentSizeIdentifier;

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

               - (void)cancelBannerViewAction;


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




                                                                                              http://pardel.net
SkillsMatter - August 12th 2010




iAd.framework
               @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers;

ADBannerView   @property (nonatomic, copy) NSString *currentContentSizeIdentifier;

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

               - (void)cancelBannerViewAction;


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

               ADBannerContentSizeIdentifier320x50
               ADBannerContentSizeIdentifier480x32




                                                                                              http://pardel.net
SkillsMatter - August 12th 2010




  iAd.framework
   ADBannerView




                   ADBannerViewDelegate


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

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

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




                                                                                              http://pardel.net
SkillsMatter - August 12th 2010




  iAd.framework
   ADBannerView




                   ADBannerViewDelegate


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

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

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




                                        Demo                                                  http://pardel.net
SkillsMatter - August 12th 2010




iAd JS
         HTML5 + CSS3


         ✦   Banner
         ✦   Main advertising screen




                                                      http://pardel.net
SkillsMatter - August 12th 2010




4. Game Center



                                http://pardel.net
SkillsMatter - August 12th 2010




Game Center

       ✦ Beta

       ✦ Socialgaming network
       ✦ Leaderboards & Achievements




                                                http://pardel.net
SkillsMatter - August 12th 2010




5. New Frameworks & APIs



                                   http://pardel.net
SkillsMatter - August 12th 2010




Block Objects




                               http://pardel.net
SkillsMatter - August 12th 2010




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




                                                                              http://pardel.net
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
SkillsMatter - August 12th 2010




Blocks




                        http://pardel.net
SkillsMatter - August 12th 2010




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




                                                                              http://pardel.net
SkillsMatter - August 12th 2010




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




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




                                                                                 http://pardel.net
SkillsMatter - August 12th 2010




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




 int multiplier = 5;


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




                                                                                 http://pardel.net
SkillsMatter - August 12th 2010




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




 int multiplier = 5;


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


 myBlock(7);




                                                                                 http://pardel.net
SkillsMatter - August 12th 2010




New Frameworks

Quick Look
Event Kit
Core Motion
Core Telephony
Data Protection



                                 http://pardel.net
SkillsMatter - August 12th 2010




Event Kit




                           http://pardel.net
SkillsMatter - August 12th 2010




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




                                                                                http://pardel.net
SkillsMatter - August 12th 2010




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



  EKCalendar




                                                                                http://pardel.net
SkillsMatter - August 12th 2010




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



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


                                                                                http://pardel.net
SkillsMatter - August 12th 2010




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



  EKCalendar                             EKEvent
  typedef enum {
    EKCalendarTypeLocal,                 alarms -> EKAlarm
    EKCalendarTypeCalDAV,                organizer, attendees -> EKParticipant
    EKCalendarTypeExchange,              recurrenceRule -> EKRecurrenceRule
    EKCalendarTypeSubscription,
    EKCalendarTypeBirthday,
  } EKCalendarType;


                                                                                 http://pardel.net
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
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
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
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
SkillsMatter - August 12th 2010




Thank you


       http://pardel.net
       http://twitter.com/pardel




                                                  http://pardel.net

Mais conteúdo relacionado

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

Phone gap
Phone gapPhone gap
Phone gap
caviare
 
Inside Dvm tools
Inside Dvm toolsInside Dvm tools
Inside Dvm tools
Mykola Bova
 
SimpleK12 Webinar - You Got an iPad, Now What? 031312
SimpleK12 Webinar - You Got an iPad, Now What? 031312SimpleK12 Webinar - You Got an iPad, Now What? 031312
SimpleK12 Webinar - You Got an iPad, Now What? 031312
Christopher Casal
 

Semelhante a In The Brain of Paul Ardeleanu: What's new in iOS 4 (20)

Phone gap
Phone gapPhone gap
Phone gap
 
Inside Dvm tools
Inside Dvm toolsInside Dvm tools
Inside Dvm tools
 
GDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android NGDG Devfest 2016 session on Android N
GDG Devfest 2016 session on Android N
 
RubyMotionでiOS開発
RubyMotionでiOS開発RubyMotionでiOS開発
RubyMotionでiOS開発
 
Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013
 
Rapid-ruby-api-on-grape
Rapid-ruby-api-on-grapeRapid-ruby-api-on-grape
Rapid-ruby-api-on-grape
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
 
I時代的工作術
I時代的工作術I時代的工作術
I時代的工作術
 
[Phpcamp]Shindig An OpenSocial container
[Phpcamp]Shindig An OpenSocial container[Phpcamp]Shindig An OpenSocial container
[Phpcamp]Shindig An OpenSocial container
 
SimpleK12 Webinar - You Got an iPad, Now What? 031312
SimpleK12 Webinar - You Got an iPad, Now What? 031312SimpleK12 Webinar - You Got an iPad, Now What? 031312
SimpleK12 Webinar - You Got an iPad, Now What? 031312
 
No internet!! Let your apps still work
No internet!! Let your apps still workNo internet!! Let your apps still work
No internet!! Let your apps still work
 
Health Care Clipboard iPad Application
Health Care Clipboard iPad ApplicationHealth Care Clipboard iPad Application
Health Care Clipboard iPad Application
 
O sucesso do seu app está nos detalhes!
O sucesso do seu app está nos detalhes!O sucesso do seu app está nos detalhes!
O sucesso do seu app está nos detalhes!
 
The Web Performance Testing Toolbox (Jfokus 2013)
The Web Performance Testing Toolbox (Jfokus 2013)The Web Performance Testing Toolbox (Jfokus 2013)
The Web Performance Testing Toolbox (Jfokus 2013)
 
Lecture #4 activities &amp; fragments
Lecture #4  activities &amp; fragmentsLecture #4  activities &amp; fragments
Lecture #4 activities &amp; fragments
 
GWT Architectures and Lessons Learned (WJAX 2013)
GWT Architectures and Lessons Learned (WJAX 2013)GWT Architectures and Lessons Learned (WJAX 2013)
GWT Architectures and Lessons Learned (WJAX 2013)
 
Ruby conf2012
Ruby conf2012Ruby conf2012
Ruby conf2012
 
iOS Developers Conference-iOS Automation with Cucumber, Appium and Saucelabs
iOS Developers Conference-iOS Automation with Cucumber, Appium and SaucelabsiOS Developers Conference-iOS Automation with Cucumber, Appium and Saucelabs
iOS Developers Conference-iOS Automation with Cucumber, Appium and Saucelabs
 
Manoj singhal resume
Manoj singhal resumeManoj singhal resume
Manoj singhal resume
 
5 Thing You're Not Doing, 4 Things You Should Stop Doing & 3 Things You Shoul...
5 Thing You're Not Doing, 4 Things You Should Stop Doing & 3 Things You Shoul...5 Thing You're Not Doing, 4 Things You Should Stop Doing & 3 Things You Shoul...
5 Thing You're Not Doing, 4 Things You Should Stop Doing & 3 Things You Shoul...
 

Último

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

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

  • 1. What’s new in iOS4 Paul Ardeleanu @pardel SkillsMatter - August 12th 2010
  • 2. SkillsMatter - August 12th 2010 What was missing? Multitasking Flash http://pardel.net
  • 3. SkillsMatter - August 12th 2010 What’s new in iOS4? Multitasking Local Notifications iAd Game Center New Frameworks & APIs http://pardel.net
  • 4. SkillsMatter - August 12th 2010 1. Multitasking http://pardel.net
  • 5. SkillsMatter - August 12th 2010 1. Multitasking ... of a different kind http://pardel.net
  • 6. SkillsMatter - August 12th 2010 Multitasking http://pardel.net
  • 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
  • 26. SkillsMatter - August 12th 2010 UIApplicationDelegate Callbacks // // MyAppDelegate.m // - (void)applicationWillResignActive:(UIApplication *)application - (void)applicationDidEnterBackground:(UIApplication *)application - (void)applicationWillEnterForeground:(UIApplication *)application - (void)applicationDidBecomeActive:(UIApplication *)application - (void)applicationWillTerminate:(UIApplication *)application UIApplicationDidEnterBackgroundNotification UIApplicationDidEnterForegroundNotification http://pardel.net
  • 27. SkillsMatter - August 12th 2010 UIApplicationDelegate Callbacks // // MyAppDelegate.m // - (void)applicationWillResignActive:(UIApplication *)application - (void)applicationDidEnterBackground:(UIApplication *)application - (void)applicationWillEnterForeground:(UIApplication *)application - (void)applicationDidBecomeActive:(UIApplication *)application - (void)applicationWillTerminate:(UIApplication *)application UIApplicationDidEnterBackgroundNotification UIApplicationDidEnterForegroundNotification Demo http://pardel.net
  • 28. SkillsMatter - August 12th 2010 UIApplication typedef enum { UIApplicationStateActive, UIApplicationStateInactive, UIApplicationStateBackground } UIApplicationState; @property(nonatomic,readonly) UIApplicationState applicationState [[UIApplication sharedApplication] applicationState] 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
  • 44. SkillsMatter - August 12th 2010 Task completion UIApplication - (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler: (void(^)(void))handler; - (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier; @property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining; http://pardel.net
  • 45. SkillsMatter - August 12th 2010 Task completion UIApplication - (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler: (void(^)(void))handler; - (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier; @property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining; typedef NSUInteger UIBackgroundTaskIdentifier; http://pardel.net
  • 46. SkillsMatter - August 12th 2010 Task completion UIApplication - (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler: (void(^)(void))handler; - (void)endBackgroundTask:(UIBackgroundTaskIdentifier)identifier; @property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining; typedef NSUInteger UIBackgroundTaskIdentifier; self.bgTaskId = [app beginBackgroundTaskWithExpirationHandler: ^{ [self stopLongTask]; }]; ... [[UIApplication sharedApplication] endBackgroundTask:self.bgTaskId]; http://pardel.net
  • 47. SkillsMatter - August 12th 2010 Background Services Task completion Background Audio VoIP Background Location http://pardel.net
  • 48. SkillsMatter - August 12th 2010 Background Services 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
  • 58. SkillsMatter - August 12th 2010 Turn by turn directions locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; [locationManager startUpdatingLocation]; http://pardel.net
  • 59. 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; 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
  • 65. SkillsMatter - August 12th 2010 Location tracking a) Significant location changing locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; [locationManager startMonitoringSignificantLocationChanges]; http://pardel.net
  • 66. SkillsMatter - August 12th 2010 Location tracking a) Significant location changing locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; [locationManager startMonitoringSignificantLocationChanges]; - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation http://pardel.net
  • 67. SkillsMatter - August 12th 2010 Location tracking b) Region monitoring (iPhone4 only) http://pardel.net
  • 68. SkillsMatter - August 12th 2010 Location tracking b) Region monitoring (iPhone4 only) http://pardel.net
  • 69. SkillsMatter - August 12th 2010 Location tracking b) Region monitoring (iPhone4 only) - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation http://pardel.net
  • 70. SkillsMatter - August 12th 2010 Location tracking b) Region monitoring (iPhone4 only) 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]; - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation http://pardel.net
  • 71. SkillsMatter - August 12th 2010 Multitasking http://pardel.net
  • 72. SkillsMatter - August 12th 2010 Multitasking Fast app switching Task Completion Background Audio Navigation & Location tracking VoIP http://pardel.net
  • 73. SkillsMatter - August 12th 2010 2. Local Notifications http://pardel.net
  • 74. SkillsMatter - August 12th 2010 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]; } } } http://pardel.net
  • 75. SkillsMatter - August 12th 2010 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 http://pardel.net
  • 76. SkillsMatter - August 12th 2010 3. iAd 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
  • 78. SkillsMatter - August 12th 2010 iAd CPM + CPC = eCPM http://pardel.net
  • 79. SkillsMatter - August 12th 2010 iAd CPM + CPC = eCPM http://pardel.net
  • 80. SkillsMatter - August 12th 2010 iAd CPM + CPC = eCPM 60% revenues http://pardel.net
  • 81. SkillsMatter - August 12th 2010 iAd http://pardel.net
  • 82. SkillsMatter - August 12th 2010 iAd.framework @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers; ADBannerView @property (nonatomic, copy) NSString *currentContentSizeIdentifier; @property(nonatomic, readonly) BOOL bannerLoaded; @property(nonatomic, readonly) BOOL bannerViewActionInProgress; - (void)cancelBannerViewAction; @property(nonatomic, assign) id<ADBannerViewDelegate> delegate; http://pardel.net
  • 83. SkillsMatter - August 12th 2010 iAd.framework @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers; ADBannerView @property (nonatomic, copy) NSString *currentContentSizeIdentifier; @property(nonatomic, readonly) BOOL bannerLoaded; @property(nonatomic, readonly) BOOL bannerViewActionInProgress; - (void)cancelBannerViewAction; @property(nonatomic, assign) id<ADBannerViewDelegate> delegate; http://pardel.net
  • 84. SkillsMatter - August 12th 2010 iAd.framework @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers; ADBannerView @property (nonatomic, copy) NSString *currentContentSizeIdentifier; @property(nonatomic, readonly) BOOL bannerLoaded; @property(nonatomic, readonly) BOOL bannerViewActionInProgress; - (void)cancelBannerViewAction; @property(nonatomic, assign) id<ADBannerViewDelegate> delegate; http://pardel.net
  • 85. SkillsMatter - August 12th 2010 iAd.framework @property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers; ADBannerView @property (nonatomic, copy) NSString *currentContentSizeIdentifier; @property(nonatomic, readonly) BOOL bannerLoaded; @property(nonatomic, readonly) BOOL bannerViewActionInProgress; - (void)cancelBannerViewAction; @property(nonatomic, assign) id<ADBannerViewDelegate> delegate; ADBannerContentSizeIdentifier320x50 ADBannerContentSizeIdentifier480x32 http://pardel.net
  • 86. SkillsMatter - August 12th 2010 iAd.framework ADBannerView ADBannerViewDelegate - (void)bannerViewDidLoadAd:(ADBannerView *)banner; - (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave; - (void)bannerViewActionDidFinish:(ADBannerView *)banner; - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error; http://pardel.net
  • 87. SkillsMatter - August 12th 2010 iAd.framework ADBannerView ADBannerViewDelegate - (void)bannerViewDidLoadAd:(ADBannerView *)banner; - (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave; - (void)bannerViewActionDidFinish:(ADBannerView *)banner; - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error; Demo http://pardel.net
  • 88. SkillsMatter - August 12th 2010 iAd JS HTML5 + CSS3 ✦ Banner ✦ Main advertising screen http://pardel.net
  • 89. SkillsMatter - August 12th 2010 4. Game Center http://pardel.net
  • 90. SkillsMatter - August 12th 2010 Game Center ✦ Beta ✦ Socialgaming network ✦ Leaderboards & Achievements http://pardel.net
  • 91. SkillsMatter - August 12th 2010 5. New Frameworks & APIs http://pardel.net
  • 92. SkillsMatter - August 12th 2010 Block Objects http://pardel.net
  • 93. SkillsMatter - August 12th 2010 Block Objects self.bgTaskId = [app beginBackgroundTaskWithExpirationHandler:^{ [self stopLongTask]; }]; 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
  • 95. SkillsMatter - August 12th 2010 Blocks http://pardel.net
  • 96. SkillsMatter - August 12th 2010 Blocks returnType (^myBlockName) (argumentType) = ^(argumentType argumentName) { returnType x; ... return x; } http://pardel.net
  • 97. SkillsMatter - August 12th 2010 Blocks returnType (^myBlockName) (argumentType) = ^(argumentType argumentName) { returnType x; ... return x; } int (^myBlock) (int) = ^(int num) { return num * multiplier; } http://pardel.net
  • 98. SkillsMatter - August 12th 2010 Blocks returnType (^myBlockName) (argumentType) = ^(argumentType argumentName) { returnType x; ... return x; } int multiplier = 5; int (^myBlock) (int) = ^(int num) { return num * multiplier; } http://pardel.net
  • 99. SkillsMatter - August 12th 2010 Blocks returnType (^myBlockName) (argumentType) = ^(argumentType argumentName) { returnType x; ... return x; } int multiplier = 5; int (^myBlock) (int) = ^(int num) { return num * multiplier; } myBlock(7); http://pardel.net
  • 100. SkillsMatter - August 12th 2010 New Frameworks Quick Look Event Kit Core Motion Core Telephony Data Protection http://pardel.net
  • 101. SkillsMatter - August 12th 2010 Event Kit http://pardel.net
  • 102. SkillsMatter - August 12th 2010 Event Kit EKEventStore @property(nonatomic, readonly) NSArray *calendars @property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents http://pardel.net
  • 103. SkillsMatter - August 12th 2010 Event Kit EKEventStore @property(nonatomic, readonly) NSArray *calendars @property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents EKCalendar http://pardel.net
  • 104. SkillsMatter - August 12th 2010 Event Kit EKEventStore @property(nonatomic, readonly) NSArray *calendars @property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents EKCalendar typedef enum { EKCalendarTypeLocal, EKCalendarTypeCalDAV, EKCalendarTypeExchange, EKCalendarTypeSubscription, EKCalendarTypeBirthday, } EKCalendarType; http://pardel.net
  • 105. SkillsMatter - August 12th 2010 Event Kit EKEventStore @property(nonatomic, readonly) NSArray *calendars @property(nonatomic, readonly) EKCalendar *defaultCalendarForNewEvents EKCalendar EKEvent typedef enum { EKCalendarTypeLocal, alarms -> EKAlarm EKCalendarTypeCalDAV, organizer, attendees -> EKParticipant EKCalendarTypeExchange, recurrenceRule -> EKRecurrenceRule EKCalendarTypeSubscription, EKCalendarTypeBirthday, } EKCalendarType; 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