SlideShare a Scribd company logo
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 file 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
Konfigurasi app ID
Peringatan!
Configuration name for identifier, entitlements
 file, iCloud key-value store, containers and
           keychain access groups.
Entitlements Setting
Ubiquitous Documents
UIDocument




Asynchronous block-based reading and writing

Auto-saving

Flat file and file packages
UIDocument with iCloud



Acts as a file coordinator and presenter

Mendeteksi conflicts

- Notifications
- 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

UIDocumentStateChangedNotification
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 configure 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 notification
updates
Content organization
Background
downloads
Menampilkan pada Newsstand
Menjadikan Newsstand app



  Menambahkan satu key dalam file
  Info.plist
     <key>UINewsstandApp</key>

     <true/>


  Yak jadilah Newsstand app!

  Tapi masih butuh icon nih.
Menampilkan pada Newsstand
Standard icon specification
                          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 file             <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 notifications
Informing the App
Newsstand Push Notifications
Informing the App
Newsstand Push Notifications
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...

More Related Content

What's hot

iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
WO Community
 
Third Party Auth in WebObjects
Third Party Auth in WebObjectsThird Party Auth in WebObjects
Third Party Auth in WebObjects
WO Community
 
ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
Satoshi Asano
 
iCloud keychain
iCloud keychainiCloud keychain
iCloud keychain
Alexey Troshichev
 
Better Data Persistence on Android
Better Data Persistence on AndroidBetter Data Persistence on Android
Better Data Persistence on Android
Eric Maxwell
 
Local Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban TothLocal Authentication par Pierre-Alban Toth
Local Authentication par Pierre-Alban Toth
CocoaHeads France
 
Adventures in Multithreaded Core Data
Adventures in Multithreaded Core DataAdventures in Multithreaded Core Data
Adventures in Multithreaded Core Data
Inferis
 
Dockercompose
DockercomposeDockercompose
Dockercompose
Rory Preddy
 
What's Parse
What's ParseWhat's Parse
What's Parse
Tsutomu Ogasawara
 
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
Hector Ramos
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
jeromevdl
 
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
David Lapsley
 
Oak Lucene Indexes
Oak Lucene IndexesOak Lucene Indexes
Oak Lucene Indexes
Chetan Mehrotra
 
Deploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesDeploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab Facilities
FIWARE
 
Hidden Treasures in Project Wonder
Hidden Treasures in Project WonderHidden Treasures in Project Wonder
Hidden Treasures in Project Wonder
WO Community
 
Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
Tushar Acharya
 
async/await in Swift
async/await in Swiftasync/await in Swift
async/await in Swift
Peter Friese
 
Launching Beeline with Firebase
Launching Beeline with FirebaseLaunching Beeline with Firebase
Launching Beeline with Firebase
Chetan 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, Moscow
Robert 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 2014
Amazon Web Services
 

What's hot (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
 

Viewers also liked

iOS - development
iOS - developmentiOS - development
iOS - development
Alexandru Terente
 
iOS 5
iOS 5iOS 5
iOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTechiOS 5 Kick-Start @ISELTech
iOS 5 Kick-Start @ISELTech
Bruno Pires
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
Hussain 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 draft001
Alexandru Terente
 
Fwt ios 5
Fwt ios 5Fwt ios 5
Fwt ios 5
Pat Zearfoss
 
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
Ben Gaddis
 
iOS PPT
iOS PPTiOS PPT
iOS PPT
Sarika Naidu
 

Viewers also liked (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
 

Similar to iOS5 NewStuff

Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
Satoshi Asano
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
lmrei
 
20120121
2012012120120121
20120121
komarineko
 
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
Carl Brown
 
занятие8
занятие8занятие8
занятие8
Oleg Parinov
 
iOS
iOSiOS
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 Implementation
Abdul 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 Backend
Stefano Zanetti
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
Petr Dvorak
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
Petr Dvorak
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
Kacper Gunia
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
Eyal 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 contexts
Matthew Morey
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
Shahar Evron
 
iOS & Drupal
iOS & DrupaliOS & Drupal
iOS & Drupal
Foti 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 7
barcelonaio
 
Simpler Core Data with RubyMotion
Simpler Core Data with RubyMotionSimpler Core Data with RubyMotion
Simpler Core Data with RubyMotion
Stefan Haflidason
 

Similar to 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
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 

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 file koordinator Menerapkan ‘NSFilePresenter’ agar mendapat pemberitahuan akan adanya perubahan Saat file 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. Configuration name for identifier, entitlements file, iCloud key-value store, containers and keychain access groups.
  • 18. UIDocument Asynchronous block-based reading and writing Auto-saving Flat file and file packages
  • 19. UIDocument with iCloud Acts as a file coordinator and presenter Mendeteksi conflicts - Notifications - 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 filters’ pada video and gambar menyediakan juga fitur untuk membuat ‘custom filters’
  • 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 configure 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 file Info.plist <key>UINewsstandApp</key> <true/> Yak jadilah Newsstand app! Tapi masih butuh icon nih.
  • 47. Menampilkan pada Newsstand Standard icon specification 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 file <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 notifications
  • 52. Informing the App Newsstand Push Notifications
  • 53. Informing the App Newsstand Push Notifications
  • 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 • Modifications -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)]

Editor's Notes

  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