SlideShare a Scribd company logo
iOS 8 Action Extension
Tech Talk Training Series
- 07/18/2014 -
Yuichi Fujiki
What can you do with extension?
•Provide a program for other apps to use
• Today
• Action
• Share
• Photo Editing
• Document Provider
• Custom Keyboard
What can you do with extension?
•Provide a program for other apps to use
• Today
• Action
• Share
• Photo Editing
• Document Provider
• Custom Keyboard
What can you do with extension?
•Provide a program for other apps to use
• Today
• Action
• Share
• Photo Editing
• Document Provider
• Custom Keyboard
What can you do with extension?
•Provide a program for other apps to use
• Today
• Action
• Share
• Photo Editing
• Document Provider
• Custom Keyboard
What can you do with extension?
•Provide a program for other apps to use
• Today
• Action
• Share
• Photo Editing
• Document Provider
• Custom Keyboard
What can you do with extension?
•Provide a program for other apps to use
• Today
• Action
• Share
• Photo Editing
• Document Provider
• Custom Keyboard
What can you do with extension?
•Provide a program for other apps to use
• Today
• Action
• Share
• Photo Editing
• Document Provider
• Custom Keyboard
What you can NOT do with extension
•Define custom extension point
• Provide extension by itself
• Needs to accompany with an ‘app’
Other things to note
• Extension runs as a separate process from containing app
• Also sandboxed
• Basically, you can consider extension is a ViewController presented from
different extension point
Step 0
1.Clone https://github.com/yfujiki/MyPhotoFilter.git
2.% git checkout refs/tags/step0
Step 1
1.Add action extension
2.Limit the extension point only to image item
• NSExtensionActivationSupportsImageWithMaxCount=1
Step 2
Pass image from containing app to extension
1.Present UIActivityViewController specifying the image
(“TunnelView”)
2.The initial action extension template already includes the code
to display image
NSExtensionContext
NSExtensionItem
NSExtensionItem
NSExtensionItem
NSItemProvider
self.extensionContext
inputItems attachments
Step 3
Receive image from Photos app
1.Create image from NSURL
•Photos app provides image via URL
Step 4
Add image filters to extension
1.Let’s just checkout refs/tags/step4 :))
Step 5
Pass edited image back to the host app
1. In Extension, package edited image into NSItemProvider and pass to Host
App
• NSExtensionContext.completeRequestReturningItems(…)
2. In Containing App, unpack passed image
• UIActivityViewController.completionItemsHandler = {

(activityType:String!, animated:Bool, items:[AnyObject]!, error:NSError!) in

…

}

Step 6
Save edited image to Photos app too
1.Use AssetsLibrary
•Photos framework is supposed to replace AssetsLibrary
Step 7
Move general use methods to framework
1.Add framework target
2.import YourFrameWork
Step 8
Add Safari Extension
1.Add entries in Info.plist
• NSExtentionActionvationSupportsWebURLMaxCount = 1
• NSExtensionJavaScriptPreprocessingFile = Action
• Also create “Action.js” corresponding to the entry
2. Add run method in Action.js and pass selected DOM information to extension
3. Parse the passed DOM information as plist and obtain image URL
4. Pass the edited image back to Action.js as URL
5. Implement finalize method in Action.js and replace img element with passed URL
Where to go from here?
• Different media (video, music, text etc)
• Different Extension Point
• Skip the view
• Choose “Request Handling” for Action Type
• Share data between your containing app and extension
• Use good-old “Open URL” approach and launch app
• Use App Group functionality

More Related Content

PDF
iOS extension
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
PPTX
Android App Development 20150604
PDF
Unity - Android by Rio
iOS extension
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
Android App Development 20150604
Unity - Android by Rio

What's hot (19)

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

Similar to iOS 8 Action Extension Training (20)

PPTX
iOS 8 App Extensions
PDF
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
PDF
Gigigo Workshop - iOS Extensions
PDF
Unity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
PPTX
Evaluation how did you use media technologies
PDF
Building a mobile app connected to WordPress with WP-AppKit
PPTX
android is ready for study to all the students and share as soon as possible
PDF
Developing AR and VR Experiences with Unity
PPTX
Android overview
PPTX
PPTX
Question 4 How did you use media technologies in the construction and researc...
PPTX
Perspective presentation
PPTX
How to Access and Use Gemini API for Free.pptx
PDF
Building VR Applications For Google Cardboard
PPTX
Flutter presentation for Gujarat University
PPTX
Android Application Development
PPT
Evaluation Question 4
PPTX
Android Development recipes with java.pptx
PDF
Yaron Inger - Enlight - Inside the app of the year
PPTX
Evaluation - Question 1
iOS 8 App Extensions
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Gigigo Workshop - iOS Extensions
Unity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
Evaluation how did you use media technologies
Building a mobile app connected to WordPress with WP-AppKit
android is ready for study to all the students and share as soon as possible
Developing AR and VR Experiences with Unity
Android overview
Question 4 How did you use media technologies in the construction and researc...
Perspective presentation
How to Access and Use Gemini API for Free.pptx
Building VR Applications For Google Cardboard
Flutter presentation for Gujarat University
Android Application Development
Evaluation Question 4
Android Development recipes with java.pptx
Yaron Inger - Enlight - Inside the app of the year
Evaluation - Question 1
Ad

Recently uploaded (20)

PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Introduction to Artificial Intelligence
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
System and Network Administraation Chapter 3
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
medical staffing services at VALiNTRY
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Design an Analysis of Algorithms I-SECS-1021-03
Introduction to Artificial Intelligence
Odoo Companies in India – Driving Business Transformation.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Reimagine Home Health with the Power of Agentic AI​
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Internet Downloader Manager (IDM) Crack 6.42 Build 41
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Navsoft: AI-Powered Business Solutions & Custom Software Development
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
System and Network Administraation Chapter 3
Odoo POS Development Services by CandidRoot Solutions
medical staffing services at VALiNTRY
Upgrade and Innovation Strategies for SAP ERP Customers
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Choose the Right IT Partner for Your Business in Malaysia
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design

iOS 8 Action Extension Training

  • 1. iOS 8 Action Extension Tech Talk Training Series - 07/18/2014 - Yuichi Fujiki
  • 2. What can you do with extension? •Provide a program for other apps to use • Today • Action • Share • Photo Editing • Document Provider • Custom Keyboard
  • 3. What can you do with extension? •Provide a program for other apps to use • Today • Action • Share • Photo Editing • Document Provider • Custom Keyboard
  • 4. What can you do with extension? •Provide a program for other apps to use • Today • Action • Share • Photo Editing • Document Provider • Custom Keyboard
  • 5. What can you do with extension? •Provide a program for other apps to use • Today • Action • Share • Photo Editing • Document Provider • Custom Keyboard
  • 6. What can you do with extension? •Provide a program for other apps to use • Today • Action • Share • Photo Editing • Document Provider • Custom Keyboard
  • 7. What can you do with extension? •Provide a program for other apps to use • Today • Action • Share • Photo Editing • Document Provider • Custom Keyboard
  • 8. What can you do with extension? •Provide a program for other apps to use • Today • Action • Share • Photo Editing • Document Provider • Custom Keyboard
  • 9. What you can NOT do with extension •Define custom extension point • Provide extension by itself • Needs to accompany with an ‘app’
  • 10. Other things to note • Extension runs as a separate process from containing app • Also sandboxed • Basically, you can consider extension is a ViewController presented from different extension point
  • 12. Step 1 1.Add action extension 2.Limit the extension point only to image item • NSExtensionActivationSupportsImageWithMaxCount=1
  • 13. Step 2 Pass image from containing app to extension 1.Present UIActivityViewController specifying the image (“TunnelView”) 2.The initial action extension template already includes the code to display image NSExtensionContext NSExtensionItem NSExtensionItem NSExtensionItem NSItemProvider self.extensionContext inputItems attachments
  • 14. Step 3 Receive image from Photos app 1.Create image from NSURL •Photos app provides image via URL
  • 15. Step 4 Add image filters to extension 1.Let’s just checkout refs/tags/step4 :))
  • 16. Step 5 Pass edited image back to the host app 1. In Extension, package edited image into NSItemProvider and pass to Host App • NSExtensionContext.completeRequestReturningItems(…) 2. In Containing App, unpack passed image • UIActivityViewController.completionItemsHandler = {
 (activityType:String!, animated:Bool, items:[AnyObject]!, error:NSError!) in
 …
 }

  • 17. Step 6 Save edited image to Photos app too 1.Use AssetsLibrary •Photos framework is supposed to replace AssetsLibrary
  • 18. Step 7 Move general use methods to framework 1.Add framework target 2.import YourFrameWork
  • 19. Step 8 Add Safari Extension 1.Add entries in Info.plist • NSExtentionActionvationSupportsWebURLMaxCount = 1 • NSExtensionJavaScriptPreprocessingFile = Action • Also create “Action.js” corresponding to the entry 2. Add run method in Action.js and pass selected DOM information to extension 3. Parse the passed DOM information as plist and obtain image URL 4. Pass the edited image back to Action.js as URL 5. Implement finalize method in Action.js and replace img element with passed URL
  • 20. Where to go from here? • Different media (video, music, text etc) • Different Extension Point • Skip the view • Choose “Request Handling” for Action Type • Share data between your containing app and extension • Use good-old “Open URL” approach and launch app • Use App Group functionality