SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Building android and i os apps with visual studio
Building android and i os apps with visual studioBuilding android and i os apps with visual studio
Building android and i os apps with visual studioLohith Goudagere Nagaraj
 
Google IO 2017 Recap
Google IO 2017 RecapGoogle IO 2017 Recap
Google IO 2017 RecapVishal Nayak
 
Open Social - Dark Side of the Moon
Open Social - Dark Side of the MoonOpen Social - Dark Side of the Moon
Open Social - Dark Side of the Moonvineet
 
Why choose flutter 2 over flutter 1
Why choose flutter 2 over flutter 1 Why choose flutter 2 over flutter 1
Why choose flutter 2 over flutter 1 Concetto Labs
 
Getting in the Evernote Trunk
Getting in the Evernote TrunkGetting in the Evernote Trunk
Getting in the Evernote TrunkChris Traganos
 
GAE as Android Test Portal. Part 1.
GAE as Android Test Portal. Part 1.GAE as Android Test Portal. Part 1.
GAE as Android Test Portal. Part 1.Åsa Pehrsson
 
Deploying Apps Heroku
Deploying Apps HerokuDeploying Apps Heroku
Deploying Apps HerokuAjit N K
 
Flutter: Future of App Development
Flutter: Future of App DevelopmentFlutter: Future of App Development
Flutter: Future of App Development9 series
 
Create first-web application-googleappengine
Create first-web application-googleappengineCreate first-web application-googleappengine
Create first-web application-googleappenginemarwa Ayad Mohamed
 
Building a design system with (p)react
Building a design system with (p)reactBuilding a design system with (p)react
Building a design system with (p)reactBart Waardenburg
 
Instant Apps potatotips 41
Instant Apps potatotips 41Instant Apps potatotips 41
Instant Apps potatotips 41bina1204 Hozuki
 
Apple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewApple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewSammy Sunny
 
Building a scalable app factory with Appcelerator Platform
Building a scalable app factory with Appcelerator PlatformBuilding a scalable app factory with Appcelerator Platform
Building a scalable app factory with Appcelerator PlatformAngus Fox
 
Guardian devexp and_discovery
Guardian devexp and_discoveryGuardian devexp and_discovery
Guardian devexp and_discoveryAde Oshineye
 
Devnest 110802
Devnest 110802Devnest 110802
Devnest 110802Angus Fox
 

Was ist angesagt? (19)

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

Ähnlich wie iOS 8 Action Extension Training

iOS 8 App Extensions
iOS 8 App ExtensionsiOS 8 App Extensions
iOS 8 App Extensionsravi kumar
 
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)Thinkful
 
Gigigo Workshop - iOS Extensions
Gigigo Workshop - iOS ExtensionsGigigo Workshop - iOS Extensions
Gigigo Workshop - iOS ExtensionsAlex Rupérez
 
Unity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
Unity and Microsoft Azure Cognitive Services - DIGITREK21 WorkshopUnity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
Unity and Microsoft Azure Cognitive Services - DIGITREK21 WorkshopPablo Farías Navarro
 
Evaluation how did you use media technologies
Evaluation   how did you use media technologiesEvaluation   how did you use media technologies
Evaluation how did you use media technologieschloegeorge
 
Building a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKitBuilding a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKitBenjamin LUPU
 
Developing AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityDeveloping AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityMark Billinghurst
 
Question 4 How did you use media technologies in the construction and researc...
Question 4 How did you use media technologies in the construction and researc...Question 4 How did you use media technologies in the construction and researc...
Question 4 How did you use media technologies in the construction and researc...Nay4697
 
Perspective presentation
Perspective presentationPerspective presentation
Perspective presentationOskar Hargedahl
 
How to Access and Use Gemini API for Free.pptx
How to Access and Use Gemini API for Free.pptxHow to Access and Use Gemini API for Free.pptx
How to Access and Use Gemini API for Free.pptxujjwalsoni23
 
Building VR Applications For Google Cardboard
Building VR Applications For Google CardboardBuilding VR Applications For Google Cardboard
Building VR Applications For Google CardboardMark Billinghurst
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application DevelopmentAzfar Siddiqui
 
Evaluation Question 4
Evaluation Question 4 Evaluation Question 4
Evaluation Question 4 mediarh
 
Android Development recipes with java.pptx
Android Development recipes with java.pptxAndroid Development recipes with java.pptx
Android Development recipes with java.pptxabdulqayoomjat2470
 
Yaron Inger - Enlight - Inside the app of the year
 Yaron Inger - Enlight - Inside the app of the year  Yaron Inger - Enlight - Inside the app of the year
Yaron Inger - Enlight - Inside the app of the year tlv-ios-dev
 
Evaluation - Question 1
Evaluation - Question 1Evaluation - Question 1
Evaluation - Question 1JayBWhite
 
Android Development Tutorial
Android Development TutorialAndroid Development Tutorial
Android Development TutorialGermán Bringas
 
Instant app Intro
Instant app IntroInstant app Intro
Instant app IntroJintin Lin
 

Ähnlich wie iOS 8 Action Extension Training (20)

iOS 8 App Extensions
iOS 8 App ExtensionsiOS 8 App Extensions
iOS 8 App Extensions
 
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
Build a Web App with JavaScript and jQuery (5:18:17, Los Angeles)
 
Gigigo Workshop - iOS Extensions
Gigigo Workshop - iOS ExtensionsGigigo Workshop - iOS Extensions
Gigigo Workshop - iOS Extensions
 
Unity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
Unity and Microsoft Azure Cognitive Services - DIGITREK21 WorkshopUnity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
Unity and Microsoft Azure Cognitive Services - DIGITREK21 Workshop
 
Evaluation how did you use media technologies
Evaluation   how did you use media technologiesEvaluation   how did you use media technologies
Evaluation how did you use media technologies
 
Building a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKitBuilding a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKit
 
Developing AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityDeveloping AR and VR Experiences with Unity
Developing AR and VR Experiences with Unity
 
Android overview
Android overviewAndroid overview
Android overview
 
Q4
Q4Q4
Q4
 
Question 4 How did you use media technologies in the construction and researc...
Question 4 How did you use media technologies in the construction and researc...Question 4 How did you use media technologies in the construction and researc...
Question 4 How did you use media technologies in the construction and researc...
 
Perspective presentation
Perspective presentationPerspective presentation
Perspective presentation
 
How to Access and Use Gemini API for Free.pptx
How to Access and Use Gemini API for Free.pptxHow to Access and Use Gemini API for Free.pptx
How to Access and Use Gemini API for Free.pptx
 
Building VR Applications For Google Cardboard
Building VR Applications For Google CardboardBuilding VR Applications For Google Cardboard
Building VR Applications For Google Cardboard
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
Evaluation Question 4
Evaluation Question 4 Evaluation Question 4
Evaluation Question 4
 
Android Development recipes with java.pptx
Android Development recipes with java.pptxAndroid Development recipes with java.pptx
Android Development recipes with java.pptx
 
Yaron Inger - Enlight - Inside the app of the year
 Yaron Inger - Enlight - Inside the app of the year  Yaron Inger - Enlight - Inside the app of the year
Yaron Inger - Enlight - Inside the app of the year
 
Evaluation - Question 1
Evaluation - Question 1Evaluation - Question 1
Evaluation - Question 1
 
Android Development Tutorial
Android Development TutorialAndroid Development Tutorial
Android Development Tutorial
 
Instant app Intro
Instant app IntroInstant app Intro
Instant app Intro
 

Kürzlich hochgeladen

Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Maxim Salnikov
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletAndrea Goulet
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypseTomasz Kowalczewski
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Flutter Agency
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Chirag Panchal
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024MulesoftMunichMeetup
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdfSelfMade bd
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringPrakhyath Rai
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
^Clinic ^%[+27788225528*Abortion Pills For Sale In hararekasambamuno
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio, Inc.
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...OnePlan Solutions
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAShane Coughlan
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanNeo4j
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckMarc Lester
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Eraconfluent
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Conceptsthomashtkim
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 

Kürzlich hochgeladen (20)

Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...
Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...
Abortion Clinic In Polokwane ](+27832195400*)[ 🏥 Safe Abortion Pills in Polok...
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024Food Delivery Business App Development Guide 2024
Food Delivery Business App Development Guide 2024
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
^Clinic ^%[+27788225528*Abortion Pills For Sale In harare
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 

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