18
iOS 8 App Extensions by Ravi Kumar Sr.iOS Developer email:[email protected]

iOS 8 App Extensions

Embed Size (px)

DESCRIPTION

This presentation contains the information regarding the App Extensions which is new feature available from iOS 8

Citation preview

Page 1: iOS 8 App Extensions

iOS 8 App Extensions

byRavi Kumar

Sr.iOS Developeremail:[email protected]

Page 2: iOS 8 App Extensions

● What is ios app Extension ?

● App Extension’s Life Cycle

● How an App Extension Communicates

● Some APIs Are Unavailable to App Extensions

● Creating an App Extension

● Distribute the Containing App

● Sharing Data with Your Containing App

● debug an app extension

● App Extension Types

Page 3: iOS 8 App Extensions

What is ios app Extension ?

● An app extension is different from an app

● It is a way for you to share your app’s functionality with other

apps

● you must use an app to contain and deliver your extensions

● To distribute app extensions to users, you submit a containing

app to the App Store. When a user installs your containing app,

the extensions it contains are also installed

● You can use Objective-C or Swift,Objective-C and Swift

● After installing an app extension, a user must take action to

enable it

Page 4: iOS 8 App Extensions

App Extension’s Life Cycle

● App extension isn’t an app

● Bundle is different for app and extension

Page 5: iOS 8 App Extensions

How an App Extension Communicates ● An app extension communicates

primarily with its host app.● There is a request from the host and

a response from the extension.

● There is no direct communication between an app extension and its containing app.

● The containing app isn’t even running while a contained extension is running.

● An app extension’s containing app and the host app don’t communicate at all.

Page 6: iOS 8 App Extensions

Some APIs Are Unavailable to App

Extensions

● Access a sharedApplication object, and so

cannot use any of the methods on that object.

● HealthKit framework and EventKit UI

framework are unavailable to app extensions.

● Access the camera or microphone on an iOS

device.

● Perform long-running background tasks.

● Receive data using AirDrop.

Page 7: iOS 8 App Extensions

Creating an App Extension● To add a new target to your Xcode app project, choose File >

New > Target.

Page 8: iOS 8 App Extensions

Distribute the Containing App

● You can’t submit an app extension to the App Store unless it’s inside a containing app, and you can’t transfer an extension from one app to another.

● To deliver an iOS app extension, you must submit a containing app to the App Store.

● To pass app review, your containing app must provide functionality to users; it can’t just contain app extensions.

Page 9: iOS 8 App Extensions

Sharing Data with Your Containing App

Page 10: iOS 8 App Extensions

// Create and share access to an NSUserDefaults object.

NSUserDefaults *mySharedDefaults = [[NSUserDefaults alloc]initWithSuiteName:@"com.example.domain.MyShareExtension"];

// Use the shared user defaults object to update the user's account.

[mySharedDefaults setObject:theAccountName forKey:@"lastAccountName"];

Page 11: iOS 8 App Extensions

debug an app extension

● Enable the app extension’s scheme by choosing Product > Scheme > MyExtensionName or by clicking the scheme pop-up menu in the Xcode toolbar and choosing MyExtensionName.

● Click the Build and Run button to tell Xcode to launch your specified host app.

● The Debug navigator indicates it is waiting for you to invoke the app extension.

● Invoke the app extension by way of the host app’s UI.

Page 12: iOS 8 App Extensions

App Extension Types Today

● Extensions in the Today view are called widgets.

● Widgets give users quick access to information that’s important right now .

● Ensure that content always looks up to date.

Page 13: iOS 8 App Extensions

Custom Keyboard

Page 14: iOS 8 App Extensions

Photo Editing● Photo Editing extension lets

users edit a photo or video within the Photos app.

Page 15: iOS 8 App Extensions

Share● Share extensions give

users a convenient way to share content with other entities, such as social sharing websites or upload services.

Page 16: iOS 8 App Extensions

Action● Create your own custom

action buttons● An Action extension helps

users view or transform content originating in a host app.

● Example:such as viewing an image in a different format or reading text in a different language

Page 17: iOS 8 App Extensions

Document picker● files can store and retrieve

files stored.

● the document provider act as a local repository for a particular type of document, letting the user gather all those documents into one place.

Page 18: iOS 8 App Extensions

Thank you