EXTENSIONS
OSXDev.org
김윤봉 (y8k)
OSXDev.org
김 윤 봉
@y8k
yunbong.kim@gmail.com
LET ME INTRODUCE..
EXTENSION WORKS
LIFE CYCLE
OSXDev.org
COMMUNICATES
OSXDev.org
Extension communicates directly only with host app
The host app and the containing app don’t commu...
CREATES
EXTENSION
TEMPLATES
OSXDev.org
You can get an extension bundle that ends in .appex.
Each extension template includes
- a property li...
EXTENSION INFO
OSXDev.org
Info.plist file contains
- The extension point
- Some detail about extension.
NSExtensionPointId...
CONTEXT
OSXDev.org
Extensions receives the request, helps the user perform a task,
and completes or cancels the request, a...
LIMITATION
OSXDev.org
Memory limits lower than foreground app.
Widget has lower memory limits than other extensions.
Exten...
SHARE CODE / DATA
OSXDev.org
Can use Embedded Framework both extension and containing app.
An API that extensions can’t us...
LONG-RUNNING TASK
OSXDev.org
In iOS, extension isn’t running when a background task completes,
the system launches contain...
TYPES
TODAY
Get a QUICK update or perform a QUICK task
in the Today view of Notification Center.
(called a widget)
Based UIViewC...
Info.plist
OSXDev.org
BASICS
OSXDev.org
Define height
Updating Content
System captures snapshots of widget’s view.
NCWidgetProviding protocol
SHARE
Post to a sharing website or share content
with contents.
Apply to Bookmark, Photo related Apps.
Based SLComposeServ...
Info.plist
OSXDev.org
BASICS
OSXDev.org
Set sharing items
Check content validation
ACTION
Manipulate or view content within the context of
another app.
Lightweight tasks.
Be available both iOS, OS X.
OSXDe...
Info.plist
OSXDev.org
BASICS
OSXDev.org
Sending edited items to host app
PHOTO EDITING
Edit a photo or video within the Photos app.
Only available iOS.
OSXDev.org
Info.plist
OSXDev.org
STORAGE PROVIDER
Choose a document from among the set of
documents the current iOS app can access.
Presents a UIDocumentMe...
Info.plist
OSXDev.org
CUSTOM KEYBOARD
Replace the iOS system keyboard with
a custom keyboard for use in all apps
Only available iOS.
OSXDev.org
...
BASICS
OSXDev.org
AFTER WORK
OSXDev.org
http://y8k.me
감사합니다.
Upcoming SlideShare
Loading in...5
×

[Osxdev]extensions

1,870

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,870
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
18
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

[Osxdev]extensions

  1. 1. EXTENSIONS OSXDev.org 김윤봉 (y8k)
  2. 2. OSXDev.org 김 윤 봉 @y8k yunbong.kim@gmail.com LET ME INTRODUCE..
  3. 3. EXTENSION WORKS
  4. 4. LIFE CYCLE OSXDev.org
  5. 5. COMMUNICATES OSXDev.org Extension communicates directly only with host app The host app and the containing app don’t communicate at all. An extension needs to communicate with its containing app. How to work?
  6. 6. CREATES EXTENSION
  7. 7. TEMPLATES OSXDev.org You can get an extension bundle that ends in .appex. Each extension template includes - a property list file (Info.plist). - a view controller class (or principal class). - a default user interface.
  8. 8. EXTENSION INFO OSXDev.org Info.plist file contains - The extension point - Some detail about extension. NSExtensionPointIdentifier key has point’s reverse DNS name. NSExtensionPrincipalClass key has extension view controller class. NSExtensionMainStoryboard key has default storyboard file.
  9. 9. CONTEXT OSXDev.org Extensions receives the request, helps the user perform a task, and completes or cancels the request, according to the user’s action Extension can use ‘extensionContext' property on its principal view controller. Use NSExtensionContext class to examine the context and get the items within it. NSExtensionContext *myExtensionContext = [self extensionContext]; NSArray *inputItems = [myExtensionContext inputItems]; NSExtensionItem *item = [inputItems objectAtIndex:0]; Can get the context and items in loadView method NSExtensionItem contains title, content text, attachments, user info Extension gives user a choice between - completeRequestReturingItems:expirationHandler:completion: - cancelRequestWithError:
  10. 10. LIMITATION OSXDev.org Memory limits lower than foreground app. Widget has lower memory limits than other extensions. Extension don’t own the main run loop. Extension don’t get top priority. KEEP IN MIND FOR USER EXPERIENCE
  11. 11. SHARE CODE / DATA OSXDev.org Can use Embedded Framework both extension and containing app. An API that extensions can’t use is marked NS_EXTENSION_UNAVAILABLE. Sharing Code Sharing Data Can share data between containing app and extension through App Groups. After you enable app groups, both can share data using NSUserDefaults API . NSFileCoordinator and NSFilePresent API can ensure safe data sharing.
  12. 12. LONG-RUNNING TASK OSXDev.org In iOS, extension isn’t running when a background task completes, the system launches containing app in the background and call application:handleEventsForBackgroundURLSession:completionHandler:
  13. 13. TYPES
  14. 14. TODAY Get a QUICK update or perform a QUICK task in the Today view of Notification Center. (called a widget) Based UIViewController NOT view. Be available both iOS, OS X. OSXDev.org
  15. 15. Info.plist OSXDev.org
  16. 16. BASICS OSXDev.org Define height Updating Content System captures snapshots of widget’s view. NCWidgetProviding protocol
  17. 17. SHARE Post to a sharing website or share content with contents. Apply to Bookmark, Photo related Apps. Based SLComposeServiceViewController or UIViewcontroller Be available both iOS, OS X. OSXDev.org
  18. 18. Info.plist OSXDev.org
  19. 19. BASICS OSXDev.org Set sharing items Check content validation
  20. 20. ACTION Manipulate or view content within the context of another app. Lightweight tasks. Be available both iOS, OS X. OSXDev.org Helps users view the current document. Always appears in an action sheet or full-screen modal view.
  21. 21. Info.plist OSXDev.org
  22. 22. BASICS OSXDev.org Sending edited items to host app
  23. 23. PHOTO EDITING Edit a photo or video within the Photos app. Only available iOS. OSXDev.org
  24. 24. Info.plist OSXDev.org
  25. 25. STORAGE PROVIDER Choose a document from among the set of documents the current iOS app can access. Presents a UIDocumentMenuViewController. OSXDev.org UIDocumentPickerExtensionViewController subclass is instantiated.
  26. 26. Info.plist OSXDev.org
  27. 27. CUSTOM KEYBOARD Replace the iOS system keyboard with a custom keyboard for use in all apps Only available iOS. OSXDev.org Based on UIInputViewController
  28. 28. BASICS OSXDev.org
  29. 29. AFTER WORK OSXDev.org http://y8k.me 감사합니다.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×