Pages: [1]   Go Down
  Print  
Author Topic: iCloud Drive and DocumentPicker for iOS 8: Explained  (Read 1040 times)
HCK
Global Moderator
Hero Member
*****
Posts: 79425



« on: July 15, 2014, 09:00:33 am »

iCloud Drive and DocumentPicker for iOS 8: Explained

<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p><a href='http://www.imore.com/icloud-drive-documentpicker-ios-8-explained' title="iCloud Drive and DocumentPicker for iOS 8: Explained"><img src='http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_icloud_drive_icon.jpg?itok=Xb04ESfc' />[/url]</p> <p>iCloud Drive and its associated DocumentPicker are new features of <a href="http://www.imore.com/ios-8" title="iOS 8 help, how-to, news, reviews">iOS 8[/url] that allow the app you're using to open files created in a different app, import them, move them, or export them right back out again, all without creating any unnecessary steps or complicated workflows. Everything is also automatically synced through iCloud, so changes made in one app won't only be reflected back in the original app that created the file, but on all your devices. It's yet another way inter-app communication has come to the iPhone and iPad. So, how do iCloud Drive and DocumentPicker work?<!--break--></p> <h2>From work to workflow</h2> <p><a href='http://www.imore.com/icloud-drive-documentpicker-ios-8-explained' title="iCloud Drive and DocumentPicker for iOS 8: Explained"><img src='http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_icloud_drive_windows.jpg?itok=Oq-c8Sky' />[/url]</p> <p>One of the design goals of the original iPhone and iPhone OS was to liberate mainstream customers from the legacy and tyranny of the file system — to prevent documents being strewn over a desktop or buried in a hierarchy. Sure, some people loved file systems and others learned to cope with them, but to many more they are simply confusing, inaccessible, and ultimately inhuman.</p> <p>For the Photos app, Apple provided a fairly flat repository which included the Camera Roll and an ImagePicker so that other apps could pull images out and, eventually, save them back. It was a duplicative procedure, however, and it only worked with photos and videos in that repository.</p> <p>For other files, you could access and edit them freely from within the app that created them, but they were "private" — invisible to any other app. The best you could do, if you wanted to move a file around, was to go to the original app and, if implemented, use the "Open In..." functionality to export a copy to another app. At that point, however, they were treated as separate files and changes made in one app weren't reflected in the other.</p> <p>It was maddening and I begged for years for Apple to give us a DocumentPicker equivalent to ImagePicker instead.</p> <p>Well, with iOS 8, they have.</p> <h2>How iCloud Drive works</h2> <p><a href='http://www.imore.com/icloud-drive-documentpicker-ios-8-explained' title="iCloud Drive and DocumentPicker for iOS 8: Explained"><img src='http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_icloud_drive_interface.jpg?itok=9huoj0fB' />[/url]</p> <p>There are many different types of files. Text files, documents, spreadsheets, presentations, and images are all common types. The saved state of a chess game, however, is also a file. Anything a person would consider its own discreet entity, and could possibly want to share or do something with can be considered a file.</p> <p>In iOS, all files created by an app are kept safe and secure inside that app's container. In iOS 8, to make files accessible outside their app's container — without scrapping the security — Apple is allowing developers to make those containers "public" — to make them visible.</p> <p>So, with iOS 8, when you tap to open a file, and choose iCloud Drive as your source, instead of just the files associated with the app you're in, you'll see folders representing all the other apps installed on your iPhone or iPad that have their containers set to public. Tap on one of the folders and you see the files contained in that app. Tap on one of those files and you punch a hole in the sandbox just big enough to get access to the file.</p> <p>Once you've access an external file, that file will remain accessible to the current app and to you, right alongside the internal files. iOS keeps its preview thumbnail and name — along with an optional annotation to show which app it comes from — readily available. In other words, your inter-app permission is persistent.</p> <p>So, of example, if you're in Pages and tap to open a file, then tap iCloud Drive, and you see the Editorial App folder, you can tap on that, and then tap on your Bucket List file. Pages will then open a version of the file and let you work on it. Changes you make will be saved back to the version in Editorial. And Bucket List - Editorial will, from then on, be listed alongside all your local Pages documents.</p> <p>Same with an image you started in Brushes but want to continue in Prototype, if both apps choose to support it. Same with a chess game you want to email to a friend so they can continue it for you in their version of the same chess app.</p> <p>Instead of opening files, iCloud Drive can also be used to import them instead. For example, if you wanted to bring slides from one Keynote deck into another, the file with the additional slides could be imported instead of opened. Likewise if you wanted to import an image into a Pages document.</p> <p>In addition to import, documents can be exported to other apps if you don't want to keep a copy in the current app.</p> <p>iCloud Drive launches with a grid view that shows you all files stored directly in iCloud Drive, as well as all the apps that have files stored in their own containers in iCloud Drive. Apps are distinguished by their icons placed on top of folders.</p> <p>That way, as long as you remember which app created the file, you'll have an easy way to find it. If you can't, there's a handy search box. You can also change the view from grid to list, and in list view you can quickly sort by date, name, and even tags.</p> <p>Yeah. Tags.</p> <h2>Developing for iCloud Drive and DocumentPicker.</h2> <p><a href='http://www.imore.com/icloud-drive-documentpicker-ios-8-explained' title="iCloud Drive and DocumentPicker for iOS 8: Explained"><img src='http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_icloud_drive_goodreader.jpg?itok=IU6I-4a9' />[/url]</p> <p>With iOS 8, the iCloud daemon has been rewritten on top of CloudKit, Apple's new server-side API. To avoid data loss due to read/write conflicts spanning multiple apps and devices, Apple stresses the importance of using file coordination. (The iCloud daemon makes it impossible to assume there's only ever one process accessing a file at any one time.) This avoids file corruption and data loss for customers, which is paramount.</p> <p>Apple has provided frameworks to make file coordination easy, including background cues, with high, middle, and low-level options. Unlike the previous, synchronous file coordination APIs, Apple has also provided new, asynchronous APIs. The metadata query API is also easier and faster to use, with "stitching" available, so you don't have to wait long periods of time for the information to move over. Metadata can also be accessed and displayed, even for non-local documents. (And listing documents doesn't require file coordination.)</p> <p>Document previews are encouraged because they make files more recognizable. iOS 8 makes it much, much easier to generate them as well. Apple lets developers pull an array of 1024x1024 thumbnails for a documents, and when changes are saved, updated thumbnails will be generated and synced across devices.</p> <p>Apple provides the DocumentPicker interface to handle all the interactions and to keep everything secure. DocumentPicker is what discovers files outside the current app's container, and what people use to grant permission to access and edit those documents.</p> <p>In order for DocumentPicker to discover files, the app that created those files has to signal that its container is public. If an app's container is public, its icon will show up either inside a folder in the grid view or by itself in the list view. Developers can specify the types of files their app works with, so only those file types are shown in the DocumentPicker. That keeps it focused and makes any given file easier to find.</p> <p>Once a file from another app container is opened in a new app, Apple provides a document reference as well as metadata. That way developers can list both the local files internal to their app, and the external files made available from other apps, all in the same interface, making it easier to re-open those external files again and again. (However, Apple recommends annotating those files with the name of their originating app, just to keep things clear.</p> <p>When files are imported rather than opened, iOS makes them available only temporarily. If developers want to hold on to the contents longer, they need to copy them inside the app.</p> <p>Apple also provides mechanisms for state restoration, including bookmarking. That way, you can leave a document in one app, open it in another, and pick up right where you left off.</p> <h2>iCloud Drive and DocumentPicker security</h2> <p><a href='http://www.imore.com/icloud-drive-documentpicker-ios-8-explained' title="iCloud Drive and DocumentPicker for iOS 8: Explained"><img src='http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_icloud_drive_across_devices.jpg?itok=VsVqdG8h' />[/url]</p> <p>In iOS, by default, no app can access the container of another app. Getting around that requires an explicit human override, namely opening DocumentPicker and tapping an external document to indicate you want to access it outside its container. DocumentPicker runs "out-of-process" for that reason — so it can see all apps in all public containers.</p> <p>When you tap on an external file, DocumentPicker returns a "security scoped" URL. That informs the kernel and the current app that it's allowed to open and modify the file.</p> <p>These security scoped URLs can't be saved and accessed arbitrarily. They'll lose their security if they are. So, Apple provides ways for them to be safely, securely recorded so they can be used for populating lists, restoring state, bookmarking, etc.</p> <h2>Bottom line</h2> <p>iCloud Drive and DocumentPicker are quantum leaps forward when it comes to file handling on iPhone and iPad. I could quibble about thee being no iCloud Drive app, so i can't simply browse all my files, or that there doesn't yet seem to be a way to access DocumentPicker from within the Mail app, like there is the ImagePicker. As a first step, however, both iCloud Drive and DocumentPicker are grand.</p> <p>Since Extensibility lets third party storage providers like Dropbox and corporate document stores hook in as well, they maintain much of the simplicity of iOS while returning much of the power of computing.</p> <p>In other words, iCloud Drive and DocumentPicker show we really can have nice things.</p> </div></div></div><div id="comment-wrapper-nid-25715"></div><img width='1' height='1' src='http://tipb.com.feedsportal.com/c/33998/f/616881/s/3c7f4db1/sc/4/mf.gif' border='0'/><br clear='all'/>

<a href="http://da.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/rc/1/rc.htm" rel="nofollow"><img src="http://da.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/rc/1/rc.img" border="0"/>[/url]
<a href="http://da.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/rc/2/rc.htm" rel="nofollow"><img src="http://da.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/rc/2/rc.img" border="0"/>[/url]
<a href="http://da.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/rc/3/rc.htm" rel="nofollow"><img src="http://da.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/rc/3/rc.img" border="0"/>[/url]

<img src="[url]http://da.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/a2.img" border="0"/>[/url]<img width="1" height="1" src="http://pi.feedsportal.com/r/199120386121/u/49/f/616881/c/33998/s/3c7f4db1/sc/4/a2t.img" border="0"/><img src="http://feeds.feedburner.com/~r/TheIphoneBlog/~4/4B71W-9y6s8" height="1" width="1"/>

Source: iCloud Drive and DocumentPicker for iOS 8: Explained
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: