SlideShare ist ein Scribd-Unternehmen logo
1 von 61
iOS 5 New Stuff
                  R.Ayu Maulidina.I.
Over 200 new user features
SDK & Development tools?
over 1,500 new APIs and powerful new development tools
iCloud Storage API

     Apa itu iCloud?
 - Sync service
 - Transfers user data between devices
 - Runs in background
 - Per-app sandboxing (as usual)



 Keuntungannya Apa ?

- Gak perlu ‘sync server’ sendiri.
- Gak perlu ‘network protocol’ sendiri.
- Gak perlu bayar ‘storage/bandwidth’ sendiri.

      Intinya sih gak perlu repot-repot.
Konsep dan Ketentuan iCloud



                    Ubiquitous


Suatu keadaan yang memungkinkan manusia untuk berinteraksi dengan
       ‘komputer’ dimana saja, kapan saja dan bagaimana saja.
Sinkronisasi Background



Ubiquity daemon, ubd

Saat anda menyimpan perubahan, ubd mengirimkannya pada ‘cloud’

ubd akan mengunduhnya dari iCloud

Dimana itu berarti....
Data anda dapat berubah tanpa
         peringatan..
iCloud Containers


Lokasi untuk data aplikasi anda berada di iCloud
Setiap pengaktifan iCloud pada aplikasi setidaknya hanya
memiliki satu tempat.
Kontainer sesuai dengan direktori yang kita buat
File Coordinator


Data dapat diubah oleh aplikasi anda atau oleh ubd
(Ubiquity Daemon)
Membutuhkan ‘reader/writer lock’ untuk akses koordinasi
Menggunakan ‘NSFileCoordinator’ saat menulis atau
membacanya
File Presenter

Disertakan juga pada le koordinator
Menerapkan ‘NSFilePresenter’ agar mendapat
pemberitahuan akan adanya perubahan
Saat file koordinator membuat perubahan, maka ‘file
presenter’ ini akan dipanggil.
iCloud APIs



Key-value store
Core Data
Document
Gimana cara mengaktifkan
        iCloud ?
App ID on Provisioning Portal --->
developer.apple.com/ios/ ---> app IDs
Kongurasi app ID
Peringatan!
Conguration name for identier, entitlements
 le, iCloud key-value store, containers and
           keychain access groups.
Entitlements Setting
Ubiquitous Documents
UIDocument




Asynchronous block-based reading and writing

Auto-saving

Flat le and le packages
UIDocument with iCloud



Acts as a le coordinator and presenter

Mendeteksi conflicts

- Notications
- API to help resolve
UIDocument Concepts



  Outside the (sand)box
- iCloud documents are not located in your app sandbox
- Located in your iCloud container
- Create the document in the sandbox
- Move it to iCloud
Document State


UIDocumentStateNormal

UIDocumentStateClosed

UIDocumentStateInConflict

UIDocumentStateSavingError

UIDocumentStateEditingDisabled

UIDocumentStateChangedNotication
Demo Code: CloudNotes
Subclassing UIDocument




@interface NoteDocument : UIDocument
@property (strong, readwrite) NSString *documentText;
@end
Subclassing UIDocument




- (BOOL)loadFromContents:(id)contents ofType:(NSString
*)typeName error:(NSError *__autoreleasing *)outError;
- (id)contentsForType:(NSString *)typeName error:(NSError
*__autoreleasing *)outError;
- (BOOL)loadFromContents:(id)contents ofType:(NSString
*)typeName error:(NSError *__autoreleasing *)outError
{

  NSString *text = nil;
  if ([contents length] > 0) {
    text = [[NSString alloc] initWithBytes:[contents bytes]
    length:[contents length] encoding:NSUTF8StringEncoding];
  } else {
    text = @"";
  }

}
[self setDocumentText:text];
return YES;
- (id)contentsForType:(NSString *)typeName error:(NSError
*__autoreleasing *)outError {

    if ([[self documentText] length] == 0) {
    [self setDocumentText:@"New note"];
    }
    return [NSData dataWithBytes:[[self documentText]
    UTF8String] length:[[self documentText] length]];
}
Creating a NoteDocument
- (NSURL*)ubiquitousDocumentsDirectoryURL
{
    NSURL *ubiquitousContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];

    NSURL *ubiquitousDocumentsURL = [ubiquitousContainerURL URLByAppendingPathComponent:@"Documents"];

    if (ubiquitousDocumentsURL != nil) {
        if (![[NSFileManager defaultManager] fileExistsAtPath:[ubiquitousDocumentsURL path]]) {
             NSError *createDirectoryError = nil;
             BOOL created = [[NSFileManager defaultManager] createDirectoryAtURL:ubiquitousDocumentsURL
                 withIntermediateDirectories:YES
                 attributes:0
                 error:&createDirectoryError];
             if (!created) {
                 NSLog(@"Error creating directory at %@: %@", ubiquitousDocumentsURL, createDirectoryError);
             }
        }
    } else {
        NSLog(@"Error getting ubiquitous container URL");
    }
    return ubiquitousDocumentsURL;
}
- (NSURL*)ubiquitousDocumentsDirectoryURL
{
    NSURL *ubiquitousContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];

    NSURL *ubiquitousDocumentsURL = [ubiquitousContainerURL URLByAppendingPathComponent:@"Documents"];

    if (ubiquitousDocumentsURL != nil) {
        if (![[NSFileManager defaultManager] fileExistsAtPath:[ubiquitousDocumentsURL path]]) {
             NSError *createDirectoryError = nil;
             BOOL created = [[NSFileManager defaultManager] createDirectoryAtURL:ubiquitousDocumentsURL
                 withIntermediateDirectories:YES
                 attributes:0
                 error:&createDirectoryError];
             if (!created) {
                 NSLog(@"Error creating directory at %@: %@", ubiquitousDocumentsURL, createDirectoryError);
             }
        }
    } else {
        NSLog(@"Error getting ubiquitous container URL");
    }
    return ubiquitousDocumentsURL;
}
- (void)createFileNamed:(NSString *)filename
{
    NSURL *localFileURL = [[self localDocumentsDirectoryURL] URLByAppendingPathComponent:filename];

    NoteDocument *newDocument = [[NoteDocument alloc] initWithFileURL:localFileURL];

    [newDocument saveToURL:localFileURL
        forSaveOperation:UIDocumentSaveForCreating
        completionHandler:^(BOOL success) {

          if (success) {
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

                    NSURL *destinationURL = [[self ubiquitousDocumentsDirectoryURL]
                        URLByAppendingPathComponent:filename];

                    NSError *moveToCloudError = nil;
                    BOOL success = [[NSFileManager defaultManager]
                        setUbiquitous:YES
                        itemAtURL:[newDocument fileURL]
                        destinationURL:destinationURL
                        error:&moveToCloudError];

                    if (!success) {
                        NSLog(@"Error moving to iCloud: %@", moveToCloudError);
                    }
              });
          }
    }];
}
- (void)createFileNamed:(NSString *)filename
{
    NSURL *localFileURL = [[self localDocumentsDirectoryURL] URLByAppendingPathComponent:filename];

    NoteDocument *newDocument = [[NoteDocument alloc] initWithFileURL:localFileURL];

    [newDocument saveToURL:localFileURL
        forSaveOperation:UIDocumentSaveForCreating
        completionHandler:^(BOOL success) {

          if (success) {
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

                    NSURL *destinationURL = [[self ubiquitousDocumentsDirectoryURL]
                        URLByAppendingPathComponent:filename];

                    NSError *moveToCloudError = nil;
                    BOOL success = [[NSFileManager defaultManager]
                        setUbiquitous:YES
                        itemAtURL:[newDocument fileURL]
                        destinationURL:destinationURL
                        error:&moveToCloudError];

                    if (!success) {
                        NSLog(@"Error moving to iCloud: %@", moveToCloudError);
                    }
              });
          }
    }];
}
- (void)createFileNamed:(NSString *)filename
{
    NSURL *localFileURL = [[self localDocumentsDirectoryURL] URLByAppendingPathComponent:filename];

    NoteDocument *newDocument = [[NoteDocument alloc] initWithFileURL:localFileURL];

    [newDocument saveToURL:localFileURL
        forSaveOperation:UIDocumentSaveForCreating
        completionHandler:^(BOOL success) {

          if (success) {
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

                    NSURL *destinationURL = [[self ubiquitousDocumentsDirectoryURL]
                        URLByAppendingPathComponent:filename];

                    NSError *moveToCloudError = nil;
                    BOOL success = [[NSFileManager defaultManager]
                        setUbiquitous:YES
                        itemAtURL:[newDocument fileURL]
                        destinationURL:destinationURL
                        error:&moveToCloudError];

                    if (!success) {
                        NSLog(@"Error moving to iCloud: %@", moveToCloudError);
                    }
              });
          }
    }];
}
Create new document
Core Image
image processing technology

memungkinkan proses mendekati real-time

menyediakan akses untuk ‘built-in image filters’ pada
video and gambar

menyediakan juga fitur untuk membuat ‘custom filters’
Class References


1.CIColor
2.CIContext
3.CIDetector
4.CIFaceFeature
5.CIFeature
6.CIFilter
7.CIImage
8.CIVector
Face Detection
CIFaceFeature

    Facial Features

•     hasLeftEyePosition  property
•     hasRightEyePosition  property
•     hasMouthPosition  property
•     leftEyePosition  property
•     rightEyePosition  property
•     mouthPosition  property
Demo Code: Easy Face Detection
// we'll iterate through every detected face. CIFaceFeature provides us
    // with the width for the entire face, and the coordinates of each eye
    // and the mouth if detected. Also provided are BOOL's for the eye's and
    // mouth so we can check if they already exist.
    for(CIFaceFeature* faceFeature in features)
    {
        // get the width of the face
        CGFloat faceWidth = faceFeature.bounds.size.width;

        // create a UIView using the bounds of the face
        UIView* faceView = [[UIView alloc] initWithFrame:faceFeature.bounds];

        // add a border around the newly created UIView
        faceView.layer.borderWidth = 1;
        faceView.layer.borderColor = [[UIColor redColor] CGColor];

        // add the new view to create a box around the face
        [self.window addSubview:faceView];

        if(faceFeature.hasLeftEyePosition)
        {
            // create a UIView with a size based on the width of the face
            UIView* leftEyeView = [[UIView alloc] initWithFrame:CGRectMake(faceFeature.leftEyePosition.x-faceWidth*0.15,
faceFeature.leftEyePosition.y-faceWidth*0.15, faceWidth*0.3, faceWidth*0.3)];
            // change the background color of the eye view
            [leftEyeView setBackgroundColor:[[UIColor blueColor] colorWithAlphaComponent:0.3]];
            // set the position of the leftEyeView based on the face
            [leftEyeView setCenter:faceFeature.leftEyePosition];
            // round the corners
            leftEyeView.layer.cornerRadius = faceWidth*0.15;
            // add the view to the window
            [self.window addSubview:leftEyeView];
        }

        if(faceFeature.hasRightEyePosition)
        {
            // create a UIView with a size based on the width of the face
            UIView* leftEye = [[UIView alloc] initWithFrame:CGRectMake(faceFeature.rightEyePosition.x-faceWidth*0.15,
faceFeature.rightEyePosition.y-faceWidth*0.15, faceWidth*0.3, faceWidth*0.3)];
            // change the background color of the eye view
            [leftEye setBackgroundColor:[[UIColor blueColor] colorWithAlphaComponent:0.3]];
            // set the position of the rightEyeView based on the face
            [leftEye setCenter:faceFeature.rightEyePosition];
            // round the corners
            leftEye.layer.cornerRadius = faceWidth*0.15;
            // add the new view to the window
            [self.window addSubview:leftEye];
        }
Detector Option Keys

Keys used in the options dictionary to congure a detector.


Detector Accuracy Options
NSString* const CIDetectorAccuracyLow;
NSString* const CIDetectorAccuracyHigh;

- CIDetectorAccuracyLow
Indicates that the detector should choose techniques that are lower in accuracy, but can be
processed more quickly.
- CIDetectorAccuracyHigh
Indicates that the detector should choose techniques that are higher in accuracy, even if it
requires more processing time.
Real-time Example by Erica
          Sadun
Newsstand
Newsstand for developer

Simpel dan mudah digunakan untuk konten majalah
dan surat kabar
Termasuk gratis berlangganan untuk pengguna iPhone,
iPod touch dan iPad
Menerbitkan edisi terbaru majalah dan surat kabar
langsung menggunakan Newsstand kit dan Store kit
framework
NewsstandKit



Push notication
updates
Content organization
Background
downloads
Menampilkan pada Newsstand
Menjadikan Newsstand app



  Menambahkan satu key dalam le
  Info.plist
     <key>UINewsstandApp</key>

     <true/>


  Yak jadilah Newsstand app!

  Tapi masih butuh icon nih.
Menampilkan pada Newsstand
Standard icon specication
                          Standard icon specification
                          • Top-level key in your Info.plist with an array of image name


                                                <key>CFBundleIconFiles</key>
  Key pada level paling atas di le             <array>
  Info.plist berisi array nama dari image
                                                ! <string>Icon.png</string>
                                                ! <string>Icon@2x.png</string>
                                                 ...
                                                </array>
Menampilkan pada Newsstand
Updating your Info.plist
    Updating your Info.plist

                              <key>CFBundleIcons</key>
                                                                  New top-level key
                              <dict>
                               <key>CFBundlePrimaryIcon</key>
             Icon style key
                               <dict>
                                 <key>CFBundleIconFiles</key>
                                 <array>
 Existing CFBundleIconFiles        <string>Icon.png</string>
                                   <string>Icon@2x.png</string>
                                 </array>

                               </dict>
                              </dict>
Newsstand info-plist
Handling Updates
Retrieving and presenting content




                     Retrieving and presenting content


  Informing theInforming the app
              • app                                         INFORMING
                     • Organizing issues
  Organizing        issues content
                     • Downloading
                                                UPDATING                 ORGANIZING
                     • Updating your icon
  Downloading content                                      DOWNLOADING



  Updating your icon

                                                                                      27
Informing the App
Push notications
Informing the App
Newsstand Push Notications
Informing the App
Newsstand Push Notications
Organizing Issues
Using NKLibrary




  • Provides persistent state for :
 ■ Available issues
 ■ Ongoing downloads
 ■ Issue being read

!
• Organizes issues
  ■ Uses app’s Caches directory
  ■ Improves resource management
Organizing Issues
NKIssues




   • Creating issues

  ■ Penamaan yang unik

  ■ Tanggal publikasi
 NKIssue *myIssue = [myLibrary addIssueWithName:issueName date:issueDate];



 ■ Mengolah repository di dalam ‘library’
 NSURL *baseURL = [myIssue contentURL];



• Setting the current issue

[myLibrary setCurrentlyReadingIssue:myIssue];
Handling Updates
Downloading content


Downloading Content
NKAssetDownload




     • Handles data transfer
 ■   Keeps going

• Uses NSURLConnectionDelegate

• Wake for critical events
 newsstand-content



• Wi-Fi only in background
Downloading Content
Setup




    NSArray *itemsToDownload = !! query server for list of assets

    for (item in itemsToDownload) {
       NSURLRequest *downloadRequest = [item URLRequest];
       NKAssetDownload *asset = [issue addAssetWithRequest:downloadRequest];
       NSURLConnection *connection = [asset downloadWithDelegate:myDelegate];
    }
}
Downloading Content
NSURLConnectionDownloadDelegate




   [asset downloadWithDelegate:myDelegate];


• Implements NSURLConnectionDelegate
   ■ Status
   ■ Authentication
   ■ Completion

• Modifications
-connection:didWriteData:totalBytesWritten:expectedTotalBytesWritten:
-connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytesWritten:
-connectionDidFinishDownloading:destinationURL: ---> required
Updating Your Newsstand Icon
  Update your icon and badge




   Simple!

   Update Icon
-[UIApplication setNewsstandIconImage:(UIImage*)]
• Bisa digunakan saat berjalan di background, jadi bisa diupdate kapanpun jika konten sudah siap.

  Update Badge

• Uses existing badge API
-[UIApplication setApplicationIconBadgeNumber:(NSInteger)]
Demo
Creating a Newsstand App
See you...

Weitere ähnliche Inhalte

Was ist angesagt?

iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative versionWO Community
 
Third Party Auth in WebObjects
Third Party Auth in WebObjectsThird Party Auth in WebObjects
Third Party Auth in WebObjectsWO Community
 
ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーSatoshi Asano
 
Better Data Persistence on Android
Better Data Persistence on AndroidBetter Data Persistence on Android
Better Data Persistence on AndroidEric Maxwell
 
Local Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban TothLocal Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban TothCocoaHeads France
 
Adventures in Multithreaded Core Data
Adventures in Multithreaded Core DataAdventures in Multithreaded Core Data
Adventures in Multithreaded Core DataInferis
 
Dockercompose
DockercomposeDockercompose
DockercomposeRory Preddy
 
Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksHector Ramos
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applicationsjeromevdl
 
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using DjangoOpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using DjangoDavid Lapsley
 
Oak Lucene Indexes
Oak Lucene IndexesOak Lucene Indexes
Oak Lucene IndexesChetan Mehrotra
 
Deploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesDeploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesFIWARE
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project WonderWO Community
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in SwiftPeter Friese
 
Launching Beeline with Firebase
Launching Beeline with FirebaseLaunching Beeline with Firebase
Launching Beeline with FirebaseChetan Padia
 
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowJavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowRobert Nyman
 
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014Amazon Web Services
 

Was ist angesagt? (20)

iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
 
Third Party Auth in WebObjects
Third Party Auth in WebObjectsThird Party Auth in WebObjects
Third Party Auth in WebObjects
 
ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
 
iCloud keychain
iCloud keychainiCloud keychain
iCloud keychain
 
Better Data Persistence on Android
Better Data Persistence on AndroidBetter Data Persistence on Android
Better Data Persistence on Android
 
Local Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban TothLocal Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban Toth
 
Adventures in Multithreaded Core Data
Adventures in Multithreaded Core DataAdventures in Multithreaded Core Data
Adventures in Multithreaded Core Data
 
Dockercompose
DockercomposeDockercompose
Dockercompose
 
What's Parse
What's ParseWhat's Parse
What's Parse
 
Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & Tricks
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
 
OpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using DjangoOpenStack Horizon: Controlling the Cloud using Django
OpenStack Horizon: Controlling the Cloud using Django
 
Oak Lucene Indexes
Oak Lucene IndexesOak Lucene Indexes
Oak Lucene Indexes
 
Deploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesDeploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab Facilities
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project Wonder
 
Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in Swift
 
Launching Beeline with Firebase
Launching Beeline with FirebaseLaunching Beeline with Firebase
Launching Beeline with Firebase
 
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowJavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
 
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
(DEV305) Building Apps with the AWS SDK for PHP | AWS re:Invent 2014
 

Andere mochten auch

iOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTechiOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTechBruno Pires
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1Hussain Behestee
 
iOS 5 Tech Talk World Tour 2011 draft001
iOS 5 Tech Talk World Tour 2011 draft001iOS 5 Tech Talk World Tour 2011 draft001
iOS 5 Tech Talk World Tour 2011 draft001Alexandru Terente
 
What Apple's iOS 5 Means for Marketers
What Apple's iOS 5 Means for MarketersWhat Apple's iOS 5 Means for Marketers
What Apple's iOS 5 Means for MarketersBen Gaddis
 

Andere mochten auch (8)

iOS - development
iOS - developmentiOS - development
iOS - development
 
iOS 5
iOS 5iOS 5
iOS 5
 
iOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTechiOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTech
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 
iOS 5 Tech Talk World Tour 2011 draft001
iOS 5 Tech Talk World Tour 2011 draft001iOS 5 Tech Talk World Tour 2011 draft001
iOS 5 Tech Talk World Tour 2011 draft001
 
Fwt ios 5
Fwt ios 5Fwt ios 5
Fwt ios 5
 
What Apple's iOS 5 Means for Marketers
What Apple's iOS 5 Means for MarketersWhat Apple's iOS 5 Means for Marketers
What Apple's iOS 5 Means for Marketers
 
iOS PPT
iOS PPTiOS PPT
iOS PPT
 

Ähnlich wie iOS5 NewStuff

Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Satoshi Asano
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applicationslmrei
 
20120121
2012012120120121
20120121komarineko
 
REST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourREST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourCarl Brown
 
занятие8
занятие8занятие8
занятие8Oleg Parinov
 
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV) Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV) Mobivery
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationAbdul Malik Ikhsan
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendStefano Zanetti
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical StuffPetr Dvorak
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC HydraKacper Gunia
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS ArchitectureEyal Vardi
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS InternalEyal Vardi
 
Core Data with multiple managed object contexts
Core Data with multiple managed object contextsCore Data with multiple managed object contexts
Core Data with multiple managed object contextsMatthew Morey
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkShahar Evron
 
iOS & Drupal
iOS & DrupaliOS & Drupal
iOS & DrupalFoti Dim
 
EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices MaoYang Chien
 
What's new in iOS 7
What's new in iOS 7What's new in iOS 7
What's new in iOS 7barcelonaio
 
Simpler Core Data with RubyMotion
Simpler Core Data with RubyMotionSimpler Core Data with RubyMotion
Simpler Core Data with RubyMotionStefan Haflidason
 

Ähnlich wie iOS5 NewStuff (20)

Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
20120121
2012012120120121
20120121
 
REST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourREST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A Tour
 
занятие8
занятие8занятие8
занятие8
 
iOS
iOSiOS
iOS
 
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV) Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
Core Data with multiple managed object contexts
Core Data with multiple managed object contextsCore Data with multiple managed object contexts
Core Data with multiple managed object contexts
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
 
iOS & Drupal
iOS & DrupaliOS & Drupal
iOS & Drupal
 
EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices EverNote iOS SDK introduction & practices
EverNote iOS SDK introduction & practices
 
What's new in iOS 7
What's new in iOS 7What's new in iOS 7
What's new in iOS 7
 
Simpler Core Data with RubyMotion
Simpler Core Data with RubyMotionSimpler Core Data with RubyMotion
Simpler Core Data with RubyMotion
 

KĂźrzlich hochgeladen

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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 organizationRadu Cotescu
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

KĂźrzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

iOS5 NewStuff

  • 1. iOS 5 New Stuff R.Ayu Maulidina.I.
  • 2. Over 200 new user features
  • 3. SDK & Development tools? over 1,500 new APIs and powerful new development tools
  • 4. iCloud Storage API Apa itu iCloud? - Sync service - Transfers user data between devices - Runs in background - Per-app sandboxing (as usual) Keuntungannya Apa ? - Gak perlu ‘sync server’ sendiri. - Gak perlu ‘network protocol’ sendiri. - Gak perlu bayar ‘storage/bandwidth’ sendiri. Intinya sih gak perlu repot-repot.
  • 5. Konsep dan Ketentuan iCloud Ubiquitous Suatu keadaan yang memungkinkan manusia untuk berinteraksi dengan ‘komputer’ dimana saja, kapan saja dan bagaimana saja.
  • 6. Sinkronisasi Background Ubiquity daemon, ubd Saat anda menyimpan perubahan, ubd mengirimkannya pada ‘cloud’ ubd akan mengunduhnya dari iCloud Dimana itu berarti....
  • 7. Data anda dapat berubah tanpa peringatan..
  • 8. iCloud Containers Lokasi untuk data aplikasi anda berada di iCloud Setiap pengaktifan iCloud pada aplikasi setidaknya hanya memiliki satu tempat. Kontainer sesuai dengan direktori yang kita buat
  • 9. File Coordinator Data dapat diubah oleh aplikasi anda atau oleh ubd (Ubiquity Daemon) Membutuhkan ‘reader/writer lock’ untuk akses koordinasi Menggunakan ‘NSFileCoordinator’ saat menulis atau membacanya
  • 10. File Presenter Disertakan juga pada le koordinator Menerapkan ‘NSFilePresenter’ agar mendapat pemberitahuan akan adanya perubahan Saat le koordinator membuat perubahan, maka ‘file presenter’ ini akan dipanggil.
  • 12. Gimana cara mengaktifkan iCloud ? App ID on Provisioning Portal ---> developer.apple.com/ios/ ---> app IDs
  • 15. Conguration name for identier, entitlements le, iCloud key-value store, containers and keychain access groups.
  • 18. UIDocument Asynchronous block-based reading and writing Auto-saving Flat le and le packages
  • 19. UIDocument with iCloud Acts as a le coordinator and presenter Mendeteksi conflicts - Notications - API to help resolve
  • 20. UIDocument Concepts Outside the (sand)box - iCloud documents are not located in your app sandbox - Located in your iCloud container - Create the document in the sandbox - Move it to iCloud
  • 23. Subclassing UIDocument @interface NoteDocument : UIDocument @property (strong, readwrite) NSString *documentText; @end
  • 24. Subclassing UIDocument - (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError *__autoreleasing *)outError; - (id)contentsForType:(NSString *)typeName error:(NSError *__autoreleasing *)outError;
  • 25. - (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError *__autoreleasing *)outError { NSString *text = nil; if ([contents length] > 0) { text = [[NSString alloc] initWithBytes:[contents bytes] length:[contents length] encoding:NSUTF8StringEncoding]; } else { text = @""; } } [self setDocumentText:text]; return YES;
  • 26. - (id)contentsForType:(NSString *)typeName error:(NSError *__autoreleasing *)outError { if ([[self documentText] length] == 0) { [self setDocumentText:@"New note"]; } return [NSData dataWithBytes:[[self documentText] UTF8String] length:[[self documentText] length]]; }
  • 28. - (NSURL*)ubiquitousDocumentsDirectoryURL { NSURL *ubiquitousContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; NSURL *ubiquitousDocumentsURL = [ubiquitousContainerURL URLByAppendingPathComponent:@"Documents"]; if (ubiquitousDocumentsURL != nil) { if (![[NSFileManager defaultManager] fileExistsAtPath:[ubiquitousDocumentsURL path]]) { NSError *createDirectoryError = nil; BOOL created = [[NSFileManager defaultManager] createDirectoryAtURL:ubiquitousDocumentsURL withIntermediateDirectories:YES attributes:0 error:&createDirectoryError]; if (!created) { NSLog(@"Error creating directory at %@: %@", ubiquitousDocumentsURL, createDirectoryError); } } } else { NSLog(@"Error getting ubiquitous container URL"); } return ubiquitousDocumentsURL; }
  • 29. - (NSURL*)ubiquitousDocumentsDirectoryURL { NSURL *ubiquitousContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; NSURL *ubiquitousDocumentsURL = [ubiquitousContainerURL URLByAppendingPathComponent:@"Documents"]; if (ubiquitousDocumentsURL != nil) { if (![[NSFileManager defaultManager] fileExistsAtPath:[ubiquitousDocumentsURL path]]) { NSError *createDirectoryError = nil; BOOL created = [[NSFileManager defaultManager] createDirectoryAtURL:ubiquitousDocumentsURL withIntermediateDirectories:YES attributes:0 error:&createDirectoryError]; if (!created) { NSLog(@"Error creating directory at %@: %@", ubiquitousDocumentsURL, createDirectoryError); } } } else { NSLog(@"Error getting ubiquitous container URL"); } return ubiquitousDocumentsURL; }
  • 30. - (void)createFileNamed:(NSString *)filename { NSURL *localFileURL = [[self localDocumentsDirectoryURL] URLByAppendingPathComponent:filename]; NoteDocument *newDocument = [[NoteDocument alloc] initWithFileURL:localFileURL]; [newDocument saveToURL:localFileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) { if (success) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSURL *destinationURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:filename]; NSError *moveToCloudError = nil; BOOL success = [[NSFileManager defaultManager] setUbiquitous:YES itemAtURL:[newDocument fileURL] destinationURL:destinationURL error:&moveToCloudError]; if (!success) { NSLog(@"Error moving to iCloud: %@", moveToCloudError); } }); } }]; }
  • 31. - (void)createFileNamed:(NSString *)filename { NSURL *localFileURL = [[self localDocumentsDirectoryURL] URLByAppendingPathComponent:filename]; NoteDocument *newDocument = [[NoteDocument alloc] initWithFileURL:localFileURL]; [newDocument saveToURL:localFileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) { if (success) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSURL *destinationURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:filename]; NSError *moveToCloudError = nil; BOOL success = [[NSFileManager defaultManager] setUbiquitous:YES itemAtURL:[newDocument fileURL] destinationURL:destinationURL error:&moveToCloudError]; if (!success) { NSLog(@"Error moving to iCloud: %@", moveToCloudError); } }); } }]; }
  • 32. - (void)createFileNamed:(NSString *)filename { NSURL *localFileURL = [[self localDocumentsDirectoryURL] URLByAppendingPathComponent:filename]; NoteDocument *newDocument = [[NoteDocument alloc] initWithFileURL:localFileURL]; [newDocument saveToURL:localFileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) { if (success) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSURL *destinationURL = [[self ubiquitousDocumentsDirectoryURL] URLByAppendingPathComponent:filename]; NSError *moveToCloudError = nil; BOOL success = [[NSFileManager defaultManager] setUbiquitous:YES itemAtURL:[newDocument fileURL] destinationURL:destinationURL error:&moveToCloudError]; if (!success) { NSLog(@"Error moving to iCloud: %@", moveToCloudError); } }); } }]; }
  • 35. image processing technology memungkinkan proses mendekati real-time menyediakan akses untuk ‘built-in image lters’ pada video and gambar menyediakan juga tur untuk membuat ‘custom lters’
  • 38. CIFaceFeature Facial Features •   hasLeftEyePosition  property •   hasRightEyePosition  property •   hasMouthPosition  property •   leftEyePosition  property •   rightEyePosition  property •   mouthPosition  property
  • 39. Demo Code: Easy Face Detection
  • 40. // we'll iterate through every detected face. CIFaceFeature provides us // with the width for the entire face, and the coordinates of each eye // and the mouth if detected. Also provided are BOOL's for the eye's and // mouth so we can check if they already exist. for(CIFaceFeature* faceFeature in features) { // get the width of the face CGFloat faceWidth = faceFeature.bounds.size.width; // create a UIView using the bounds of the face UIView* faceView = [[UIView alloc] initWithFrame:faceFeature.bounds]; // add a border around the newly created UIView faceView.layer.borderWidth = 1; faceView.layer.borderColor = [[UIColor redColor] CGColor]; // add the new view to create a box around the face [self.window addSubview:faceView]; if(faceFeature.hasLeftEyePosition) { // create a UIView with a size based on the width of the face UIView* leftEyeView = [[UIView alloc] initWithFrame:CGRectMake(faceFeature.leftEyePosition.x-faceWidth*0.15, faceFeature.leftEyePosition.y-faceWidth*0.15, faceWidth*0.3, faceWidth*0.3)]; // change the background color of the eye view [leftEyeView setBackgroundColor:[[UIColor blueColor] colorWithAlphaComponent:0.3]]; // set the position of the leftEyeView based on the face [leftEyeView setCenter:faceFeature.leftEyePosition]; // round the corners leftEyeView.layer.cornerRadius = faceWidth*0.15; // add the view to the window [self.window addSubview:leftEyeView]; } if(faceFeature.hasRightEyePosition) { // create a UIView with a size based on the width of the face UIView* leftEye = [[UIView alloc] initWithFrame:CGRectMake(faceFeature.rightEyePosition.x-faceWidth*0.15, faceFeature.rightEyePosition.y-faceWidth*0.15, faceWidth*0.3, faceWidth*0.3)]; // change the background color of the eye view [leftEye setBackgroundColor:[[UIColor blueColor] colorWithAlphaComponent:0.3]]; // set the position of the rightEyeView based on the face [leftEye setCenter:faceFeature.rightEyePosition]; // round the corners leftEye.layer.cornerRadius = faceWidth*0.15; // add the new view to the window [self.window addSubview:leftEye]; }
  • 41. Detector Option Keys Keys used in the options dictionary to congure a detector. Detector Accuracy Options NSString* const CIDetectorAccuracyLow; NSString* const CIDetectorAccuracyHigh; - CIDetectorAccuracyLow Indicates that the detector should choose techniques that are lower in accuracy, but can be processed more quickly. - CIDetectorAccuracyHigh Indicates that the detector should choose techniques that are higher in accuracy, even if it requires more processing time.
  • 42. Real-time Example by Erica Sadun
  • 44. Newsstand for developer Simpel dan mudah digunakan untuk konten majalah dan surat kabar Termasuk gratis berlangganan untuk pengguna iPhone, iPod touch dan iPad Menerbitkan edisi terbaru majalah dan surat kabar langsung menggunakan Newsstand kit dan Store kit framework
  • 46. Menampilkan pada Newsstand Menjadikan Newsstand app Menambahkan satu key dalam le Info.plist <key>UINewsstandApp</key> <true/> Yak jadilah Newsstand app! Tapi masih butuh icon nih.
  • 47. Menampilkan pada Newsstand Standard icon specication Standard icon specification • Top-level key in your Info.plist with an array of image name <key>CFBundleIconFiles</key> Key pada level paling atas di le <array> Info.plist berisi array nama dari image ! <string>Icon.png</string> ! <string>Icon@2x.png</string> ... </array>
  • 48. Menampilkan pada Newsstand Updating your Info.plist Updating your Info.plist <key>CFBundleIcons</key> New top-level key <dict> <key>CFBundlePrimaryIcon</key> Icon style key <dict> <key>CFBundleIconFiles</key> <array> Existing CFBundleIconFiles <string>Icon.png</string> <string>Icon@2x.png</string> </array> </dict> </dict>
  • 50. Handling Updates Retrieving and presenting content Retrieving and presenting content Informing theInforming the app • app INFORMING • Organizing issues Organizing issues content • Downloading UPDATING ORGANIZING • Updating your icon Downloading content DOWNLOADING Updating your icon 27
  • 51. Informing the App Push notications
  • 52. Informing the App Newsstand Push Notications
  • 53. Informing the App Newsstand Push Notications
  • 54. Organizing Issues Using NKLibrary • Provides persistent state for : ■ Available issues ■ Ongoing downloads ■ Issue being read ! • Organizes issues ■ Uses app’s Caches directory ■ Improves resource management
  • 55. Organizing Issues NKIssues • Creating issues ■ Penamaan yang unik ■ Tanggal publikasi NKIssue *myIssue = [myLibrary addIssueWithName:issueName date:issueDate]; ■ Mengolah repository di dalam ‘library’ NSURL *baseURL = [myIssue contentURL]; • Setting the current issue [myLibrary setCurrentlyReadingIssue:myIssue];
  • 56. Handling Updates Downloading content Downloading Content NKAssetDownload • Handles data transfer ■ Keeps going • Uses NSURLConnectionDelegate • Wake for critical events newsstand-content • Wi-Fi only in background
  • 57. Downloading Content Setup NSArray *itemsToDownload = !! query server for list of assets for (item in itemsToDownload) { NSURLRequest *downloadRequest = [item URLRequest]; NKAssetDownload *asset = [issue addAssetWithRequest:downloadRequest]; NSURLConnection *connection = [asset downloadWithDelegate:myDelegate]; } }
  • 58. Downloading Content NSURLConnectionDownloadDelegate [asset downloadWithDelegate:myDelegate]; • Implements NSURLConnectionDelegate ■ Status ■ Authentication ■ Completion • Modications -connection:didWriteData:totalBytesWritten:expectedTotalBytesWritten: -connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytesWritten: -connectionDidFinishDownloading:destinationURL: ---> required
  • 59. Updating Your Newsstand Icon Update your icon and badge Simple! Update Icon -[UIApplication setNewsstandIconImage:(UIImage*)] • Bisa digunakan saat berjalan di background, jadi bisa diupdate kapanpun jika konten sudah siap. Update Badge • Uses existing badge API -[UIApplication setApplicationIconBadgeNumber:(NSInteger)]

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n