Share extensions in 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/sharing-ios-8-explained' title="Share extensions in iOS 8: Explained"><img src='
http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_sharing_icon.jpeg?itok=RL3yEiPF' />[/url]</p> <p>The new
Extensibility features in <a href="
http://www.imore.com/ios-8" title="iOS 8 help, how-to, news, reviews">iOS 8[/url], some of the most important additions to the platform since the launch of the App Store, enable an incredible amount of functionality, including
widgets, inter-app photo editing,
third-party keyboards, and custom sharing options in the Share Sheets. That's right, sharing isn't just for Apple's own services and partners any more. Now, any app can present a way to share and upload content from within any other app. So, how does it work?<!--break--></p> <h2>Sharing from the start</h2> <p><a href='
http://www.imore.com/sharing-ios-8-explained' title="Share extensions in iOS 8: Explained"><img src='
http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_sharing_guitar_close.jpeg?itok=snSGNwu9' />[/url]</p> <p>Sharing has always been part of iOS. Even on the very first iPhone you could share a photo via Mail. As time went on, more and more sharing options became available for more and more types of data. You could share videos and location, contact cards and website addresses, app and media links, voice memos, and more. And you could do it not only through Apple's own services like <a href="
http://www.imore.com/imessage" title="activation, help, and how-to">Messages[/url] but through the services they partnered with and integrated, like Twitter and Facebook, YouTube and Flickr.</p> <p>Originally, Apple presented sharing options in a simple list. In addition to being rather drab, it didn't scale. With iOS 6, Apple added Share Sheets, a grid of icons that was both more dense and more visually parseable. Share Sheets included both the full-color icons of apps that could be used to share content, like Message or Twitter, and the grayscale icons of actions that could be performed on that content, like Copy or Print.</p> <p>However, the grid still didn't scale enough and, aside from the color treatments, didn't visually separate sharing options from action options. So, with iOS 7, Apple not only redesigned Share Sheets in keeping with the overall new look and feel, they changed them from a grid to a set of rows. The top row was given over to the colorful, app-based sharing options and the bottom row to the black and white action icons. And both sets could scroll horizontally.</p> <p>There was now room for more sharing options, but still only those made or integrated by Apple. At least until iOS 8...</p> <h2>How custom sharing works</h2> <p><a href='
http://www.imore.com/sharing-ios-8-explained' title="Share extensions in iOS 8: Explained"><img src='
http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_sharing_ipad_sheet.jpeg?itok=l3cB91gb' />[/url]</p> <p>With iOS 8 and Extensibility, gone are the days when Apple had to make a deal with social networks and laboriously integrate them one and a time into iOS. Now, any app you download from the App Store can hook into the Share Sheets and give you the option to share or upload your content with other members and to the service.</p> <p>For example, Apple and Pinterest no longer have to come to any special deals or work on any unique implementations. Pinterest can simply add a share extension to their app. That way, when you download it, the Pinterest icon and option will become available in the Share Sheet just like the built-in options.</p> <p>So, let's say you're in Safari and you see a great new iPhone case on iMore. You can simply tap the Share button, scroll across to Pinterest, and tap the icon to pin it. The sharing extension gets full access to Safari, so you can swipe through all the available images of that iPhone case and pick just exactly the one you want to pin. The extension also gets full, secure access to Pinterest via the Pinterest app, so you can choose just exactly which of your boards you want that iPhone case pinned to.</p> <p>Because of custom sharing extensions, you also get the ability to customize your sharing options. Scroll all the way to the right on a Share Sheet and you'll see a special "More" icon. Tap it and you're taken to the Activities panel where you can toggle on or off all the sharing options (with the exception of Messages and Mail), and move all of them around into any order you like.</p> <p>That means, if Pinterest is something you use a lot, you can move it to one of the first few slots. If Facebook is something you use never, you can switch it off and not worry about it taking up space and slowing you down.</p> <p>The same would hold true for other networks like Google+, options like Mailbox, or online photo or video services like 500px or Vine. Anything that you can share socially or directly, or upload to an online collection could be made available to you in a share extension.</p> <p>That makes for much easier, better workflows. Prior to iOS 8, you'd have to copy a URL, go to the social or IM app you wanted to share it from, paste it in, and then go from there. Prior to iOS 8, you'd have to go to the photo or video app you wanted to upload your content to, pull up the camera roll, search for and pick the photos or video you wanted to upload, and then go from there.</p> <p>With iOS 8 and share extensions, you basically have a plugin that lets you share right from Safari or Photos or any other apps that hooks into the Share Sheet system. You can share from wherever you are, whenever you have the content in front of you.</p> <p>Like with widgets and interactive notifications, instead of going somewhere else and hunting around for what you want to do, iOS 8 brings it to you. It's more efficient, it's more convenient, and it's just plain better.</p> <h2>Developing share extensions</h2> <p><a href='
http://www.imore.com/sharing-ios-8-explained' title="Share extensions in iOS 8: Explained"><img src='
http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/07/wwdc_2014_sharing_pinterest_view.jpeg?itok=_WsD9uyF' />[/url]</p> <p>Share extensions are a way for developers to take the sharing and uploading features of their apps, package them, and put them into the system-wide Share Sheets so they can be invoked from inside any other appropriate app.</p> <p>Like other Extensibility features, share extensions are view controllers. Two kinds of share extension view controllers are available to developers. The first is the standard, system-default share sheet look and feel. The second is a custom view controller.</p> <p>System defaults are both quick to implement and offer a lot of functionality, like image preview, text entry, audience picker, etc. "for free". They also help maintain continuity of experience. Custom sheets are more work but can leverage code from the existing app and better show off a service's branding. That can be useful in continuously, visually reminding someone which service they're sharing to throughout the process.</p> <p>In addition to view controllers, a display name tells people which app extension they're using. If apps include multiple sharing options, the a display will differentiate those as well.</p> <p>Activation rules tells the system when to offer a particular app's extension. For example, when photos are selected, the activation rules for a photo app would tell iOS that it should be included in the options. If a web link or block of text is selected, however, the activation rules for a photo app would result in it not being included — the content simply isn't relevant to it.</p> <p>Social networks, instant messengers, photo sharing services, video sharing services, microblogs, etc. can and will all have different, if sometimes overlapping activation rules. Developers can indicate their activation rules by using a predicate with as simple or as detailed a query string as is needed. Developers can also use condensed rules for even simpler criteria.</p> <p>Both web URL and web pages are supported. The first is all about sharing a link. The second is all about pulling the data from the web page itself. Developers can, via JavaScript, determine which parts of a webpage their extension wants.</p> <p>For any share extension that uploads content like photos or video, the process has to be run by the system in the background. Since extensions only "live" while they're being displayed, that allows the upload activity to persist for as long as it has to, even after someone has finished using the sharing interface and gone on to do something else.</p> <p>Performance is just as important in share extensions as they are in other Extensibility feature. Apple encourages developers to keep things lean so interface can be shown quickly. Also, if large files like photos or videos are being accessed, to defer the actual transfer until after the sharing action is completed, so the interface can stay responsive.</p> <p>There are a number of resources available to aid in all this:</p> <ul><li>
WWDC 2014 Creating Extensions for iOS and OS X session, Part 1</li> <li>
Apple (pre-release) Extensibility documentation</li> </ul><h2>Secure sharing</h2> <p><a href='
http://www.imore.com/sharing-ios-8-explained' title="Share extensions in iOS 8: Explained"><img src='
http://www.imore.com/sites/imore.com/files/styles/large/public/field/image/2014/06/wwdc_2014_extensibility_security.jpeg?itok=eev67Ss-' />[/url]</p> <p>Share extensions are designed to provide extra functionality and convenience while still maintain the security- and privacy-first approach of iOS. This is why Extensibility is different than contracts and intents on other platforms, and is broken into several different, discreet bits of functionality like share extensions, action extensions, and photo editing.</p> <p>iOS apps are "sandboxed" so they can only access their own data unless specific, explicit permission is given by the person using them. That's why apps need to request access to the camera roll, or why you have to tap the "Open in..." button. It makes it harder for malicious apps to do ever get onto the system and into your private data.</p> <p>With iOS 8 and Extensibility, Apple keeps an app's extensions inside the app's sandbox, but allows iOS, and other apps by way of iOS, to reach out, request interface, information, and functionality. The container app can then project that interface, information, and functionality back to iOS or the host app right back.</p> <p>For share extensions, the app you're sharing from is the host and the service you're sharing to is the container. For example, if you're in Safari or Photos, that's the host application. If you're sharing to Pinterest or Vine, that's the container. That not only provides security benefits but functional benefits as well. Neither the Pinterest nor Vine app needs to be running in advance for their share extension to work.</p> <p>When a share extension is invoked it communicates securely, through iOS, back to the host app for things like posting permission or content. The developer needs to make sure all of that is available in a container that both the app and the extension have access to, but is otherwise secure in and of itself. iOS will then handle things like background video upload, leaving the extension to handle the user interaction.</p> <p>Apple hasn't detailed the specifics of how all this works yet, but has said it uses similar security to the rest of iOS. Since iOS 7, Apple has done an incredible job with security and cryptography. I'm willing to bet Extensibility is enjoying something just as well thought out and just as secure.</p> <h2>Bottom line</h2> <p>Share extensions are just part of the the new Extensibility features offered in iOS 8 and a very specific part. They don't let you or developers do anything and everything. They're not area of effect, they're targeted. But what they do do is allow you to securely, privately share anything that interests you with anyone you want to share with, from anywhere and everywhere in iOS.</p> <p>You no longer have to wait for or worry about Apple making — or not making — a specific partnership and integrating a specific service. Any service with an app on the app store can now get in on the sharing, and so can we.</p> <p>Are there any social networks, instant messengers, mail apps, or photo or video sharing services you're eager to see come to Share Sheets?</p> <ul><li>
More of iOS 8: Explained</li> </ul></div></div></div><div id="comment-wrapper-nid-25440"></div><img width='1' height='1' src='
http://tipb.com.feedsportal.com/c/33998/f/616881/s/3c11b52a/sc/4/mf.gif' border='0'/><br clear='all'/>
<a href="
http://da.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/rc/1/rc.htm" rel="nofollow"><img src="
http://da.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/rc/1/rc.img" border="0"/>[/url]
<a href="
http://da.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/rc/2/rc.htm" rel="nofollow"><img src="
http://da.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/rc/2/rc.img" border="0"/>[/url]
<a href="
http://da.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/rc/3/rc.htm" rel="nofollow"><img src="
http://da.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/rc/3/rc.img" border="0"/>[/url]
<img src="[url]http://da.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/a2.img" border="0"/>[/url]<img width="1" height="1" src="
http://pi.feedsportal.com/r/199119925321/u/49/f/616881/c/33998/s/3c11b52a/sc/4/a2t.img" border="0"/><img src="
http://feeds.feedburner.com/~r/TheIphoneBlog/~4/mKaiouKgeAw" height="1" width="1"/>
Source:
Share extensions in iOS 8: Explained