SlideShare a Scribd company logo
iOS Extension
Prince
⺩王品⼠士 (Prince)
@wpsteak
github , linkedin
• App Extensions
• Today Widget & Demo
2007
iOS extension
App
App
Folder
Badge
Scenario 1
Edit a photo
Photo Home Find App Wait App Open
Find PhotoEdit Photo
Edit a photo
Photo Select App Edit Photo
Photo Editing Extension
Scenario 2
See scores from your
favorite team
Home Find App Wait App Open
wait for loading
Auto upload
Rate me
Cache
Sync
8:1
See scores from your
favorite team
Home
8:1
Today Extension
Widget
How an App Extension
Works
Open URL
Shared
Resources
App

extension
Host

app
Containing

app
Request
Response
App

extension
Host

app
Containing

app
Host app
• An app that a user employs to choose an app
extension is called a host app
Host

app
Today.app
Today
Chrome.app
Share/Action
Dropbox.app
Document Provider
Photo.app
Photo Editing
• an app that contains one or more extensions is
called a containing app
Containing app
Containing

app
extension extension extension
• an app that contains one or more extensions is
called a containing app
Containing app
App extension
• an app extension lets you extend custom
functionality and content beyond
App

extension
App extension
• an app extension lets you extend custom
functionality and content beyond
Today Extension
Today Extension
Today Extension
Today Extension
Today Extension
Dropbox
TodayView
Today.app
How an App Extension
Communicates
Dropbox
TodayView
Today.app
Database
How an App Extension
Communicates
Dropbox.app
Dropbox
TodayView
Today.app
Open URL
Database
How an App Extension
Communicates
Open URL
Shared
Resources
App

extension
Host

app
Containing

app
How an App Extension
Communicates
Share Extension
Share Extension
Share Extension
Share Extension
Share Extension
App

extension
Host

app
Containing

app
Pocket AddToPocket Chrome
Server
App

extension
Host

app
AddToPocket Chrome
Accessed via Apple
frameworks code
App

extension
Host

app
System
Framework
App

extension
Host

app
AddToPocket Chrome
UIActivityViewControllerSLComposeServiceViewController
Accessed via Apple
frameworks code
Extension Type Host App host app use
Today Today.app NotificationCenter.framework
Share any app UIActivityViewController
Action any app UIActivityViewController
Photo Editing Photo.app
PhotosUI.framework

Photos.framework
Document Provider any app UIDocumentPickerViewController
Custom Keyboard any app
Host

app
Extension Type Enter point
Today
UIViewController
<NCWidgetProviding>
Share SLComposeServiceViewController
Action SLComposeServiceViewController UI and non-UI variants
Photo Editing
UIViewController
<PHContentEditingController>
Document Provider UIDocumentPickerViewController UI and non-UI variants
Custom Keyboard UIInputViewController
App

extension
App

extension
Host

app
Containing

app
Pocket AddToPocket Chrome
Server
App

extension
Containing

app
Pocket AddToPocket
Different process
• Isolated address space
• Executes independently
• System optimizes
separately
Run Separately
App

extension
Containing

app
Shared
Resources
Share Resource
App Group
• UserDefault
• FileManager
Share Resource
NSUserDefaults *shared = [[NSUserDefaults alloc] initWithSuiteName:@“group.domain"];
NSURL *directory = [[NSFileManager defaultManager]
containerURLForSecurityApplicationGroupIdentifier:@"group.domain"];
App

extension
Containing

app
Pocket AddToPocket
ServerServer
• Same data model
• Same logic
• Same views
Share Code
App

extension
Containing

app
Pocket AddToPocket
ServerServer
• Framework
• Static library
Share Code
Share Code
NSURL *containerURL = [[NSFileManager defaultManager]
containerURLForSecurityApplicationGroupIdentifier:@"group.domain"];
NSString *sorPath = [NSString stringWithFormat:@"%@/Dylib.framework",[[NSBundle
mainBundle] bundlePath]];
NSString *desPath = [NSString stringWithFormat:@“%@/Library/Caches/
Dylib.framework",containerURL.path];
BOOL copyResult = [[NSFileManager defaultManager] copyItemAtPath: sorPath toPath:desPath
error:&err];
• Containing app is still most important
• Extension cannot without containing app
• Don't have full use of system resources
• Make it seamless
• Make it useful
Demo
Demo
• a light bulb
• sample code
• Wifi Environment
App Extension
• Create an app extension by adding a new target
to an app
• Add necessary libraries to extension target
• ViewController
Load View
• with storyboard
• NSExtensionMainStoryboard
• without interface file
• NSExtensionPrincipalClass
viewController’s life cycle
• initWithCoder:
• viewDidLoad
• widgetMarginInsetsForProposedMarginInsets:
• widgetPerformUpdateWithCompletionHandler:
• viewWillAppear:
• viewDidAppear:
• widgetMarginInsetsForProposedMarginInsets
User Interface
• UIView
• UIButton
• UILabel
• UITextField
• UIScrollView
Some APIs are Unavailable
to App Extensions
• Access a sharedApplication object
• Use any API marked in header files with the NS_EXTENSION_UNAVAILABLE macro,
or similar unavailability macro, or any API in an unavailable framework
• Access the camera or microphone on an iOS device
• Perform long-running background tasks
• The specifics of this limitation vary by platform, as described in the extension point
chapters in this document.
• (An app extension can initiate uploads or downloads using an NSURLSession
object, with results of those operations reported to the containing app.)
• Receive data using AirDrop
• (An app extension can send data using AirDrop in the same way an app does: by
employing the UIActivityViewController class.)
App Store
• NOTE ABOUT 64-BIT ARCHITECTURE
• An app extension target must include the arm64 (iOS) or x86_64 architecture
(OS X) in its Architectures build settings or it will be rejected by the App
Store. Xcode includes the appropriate 64-bit architecture with its “Standard
architectures” setting when you create a new app extension target.
• If your containing app target links to an embedded framework, the app must
also include 64-bit architecture or it will be rejected by the App Store.
App Store
End

More Related Content

PPTX
iOS 8 App Extensions
PDF
iOS 8 Action Extension Training
KEY
android_android + app engine- a developer's dream combination
KEY
Android android + app engine a developer's dream combination copy
KEY
Android android + app engine a developer's dream combination
PDF
Recap of the google io 2017
PPTX
Android studio&Gradle&Autotest
PDF
Unity - Android by Rio
iOS 8 App Extensions
iOS 8 Action Extension Training
android_android + app engine- a developer's dream combination
Android android + app engine a developer's dream combination copy
Android android + app engine a developer's dream combination
Recap of the google io 2017
Android studio&Gradle&Autotest
Unity - Android by Rio

What's hot (20)

PPTX
Android App Development 20150604
PPTX
Google IO 2017 Recap
PPT
Open Social - Dark Side of the Moon
PPTX
Building android and i os apps with visual studio
PPT
Monkey Talk
PDF
Getting in the Evernote Trunk
PPTX
Why choose flutter 2 over flutter 1
PPTX
GAE as Android Test Portal. Part 1.
PPTX
Deploying Apps Heroku
PPTX
Create first-web application-googleappengine
PDF
Instant Apps potatotips 41
PPTX
Flutter: Future of App Development
PPTX
PDF
Building a design system with (p)react
PPTX
Evaluation 4
PPTX
Apple Watch and WatchKit - A Technical Overview
KEY
Guardian devexp and_discovery
PPTX
Building a scalable app factory with Appcelerator Platform
PPTX
PPTX
Introductory Augmented Reality in Unity with Android and Vuforia
Android App Development 20150604
Google IO 2017 Recap
Open Social - Dark Side of the Moon
Building android and i os apps with visual studio
Monkey Talk
Getting in the Evernote Trunk
Why choose flutter 2 over flutter 1
GAE as Android Test Portal. Part 1.
Deploying Apps Heroku
Create first-web application-googleappengine
Instant Apps potatotips 41
Flutter: Future of App Development
Building a design system with (p)react
Evaluation 4
Apple Watch and WatchKit - A Technical Overview
Guardian devexp and_discovery
Building a scalable app factory with Appcelerator Platform
Introductory Augmented Reality in Unity with Android and Vuforia
Ad

Viewers also liked (10)

PPTX
Blockchain_visual-Rituraj
PDF
App extension for iOS
PPT
TEACH Academy Collaborative Writing
PDF
Gigigo Workshop - iOS Extensions
PPTX
iOS App Extensions
PPTX
Colaborative Writing Tools
PDF
UX, ethnography and possibilities: for Libraries, Museums and Archives
PDF
3 Things Every Sales Team Needs to Be Thinking About in 2017
PDF
Build Features, Not Apps
PDF
How to Become a Thought Leader in Your Niche
Blockchain_visual-Rituraj
App extension for iOS
TEACH Academy Collaborative Writing
Gigigo Workshop - iOS Extensions
iOS App Extensions
Colaborative Writing Tools
UX, ethnography and possibilities: for Libraries, Museums and Archives
3 Things Every Sales Team Needs to Be Thinking About in 2017
Build Features, Not Apps
How to Become a Thought Leader in Your Niche
Ad

Similar to iOS extension (20)

PDF
[Osxdev]extensions
PDF
Cocoaheads
PDF
PPTX
What’s New in iOS 8 SDK ?
PPTX
Brainstorming Creative Uses of iOS 8 Extensions / CocoaConf Columbus 2014
PPTX
iOS Extensions
PDF
Learn about iOS10 Siri Kit
PDF
Learning Swift Building Apps for OSX, iOS, and Beyond Jon Manning 2024 scribd...
PDF
Learning Swift Building Apps for OSX, iOS, and Beyond Jon Manning
PDF
Learning Swift 3 Early release 3rd Edition Jonathan Manning
PDF
How cocoapods can enhance your iOS development - Amir Hayek, Toluna
PPTX
Siri and the Upgrade Parts
PDF
Revue des annonces WWDC2015
PDF
Learning Swift 3 Early release 3rd Edition Jonathan Manning
PDF
Understanding iOS from an Android perspective
PPTX
Watch kit pitfalls. developing iOS app for Dribbble.
PDF
Siri and the upgrade parts
PDF
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
PDF
Image Processing and Computer Vision in iPhone and iPad
PPTX
Basic iOS Training with SWIFT - Part 1
[Osxdev]extensions
Cocoaheads
What’s New in iOS 8 SDK ?
Brainstorming Creative Uses of iOS 8 Extensions / CocoaConf Columbus 2014
iOS Extensions
Learn about iOS10 Siri Kit
Learning Swift Building Apps for OSX, iOS, and Beyond Jon Manning 2024 scribd...
Learning Swift Building Apps for OSX, iOS, and Beyond Jon Manning
Learning Swift 3 Early release 3rd Edition Jonathan Manning
How cocoapods can enhance your iOS development - Amir Hayek, Toluna
Siri and the Upgrade Parts
Revue des annonces WWDC2015
Learning Swift 3 Early release 3rd Edition Jonathan Manning
Understanding iOS from an Android perspective
Watch kit pitfalls. developing iOS app for Dribbble.
Siri and the upgrade parts
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Image Processing and Computer Vision in iPhone and iPad
Basic iOS Training with SWIFT - Part 1

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Essential Infomation Tech presentation.pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
System and Network Administraation Chapter 3
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Nekopoi APK 2025 free lastest update
Reimagine Home Health with the Power of Agentic AI​
Design an Analysis of Algorithms II-SECS-1021-03
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Wondershare Filmora 15 Crack With Activation Key [2025
Operating system designcfffgfgggggggvggggggggg
How to Migrate SBCGlobal Email to Yahoo Easily
Essential Infomation Tech presentation.pptx
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administraation Chapter 3
Understanding Forklifts - TECH EHS Solution
Navsoft: AI-Powered Business Solutions & Custom Software Development
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Softaken Excel to vCard Converter Software.pdf
Odoo POS Development Services by CandidRoot Solutions
PTS Company Brochure 2025 (1).pdf.......
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free

iOS extension