App extension for iOS

download App extension for iOS

of 39

  • date post

    08-Sep-2014
  • Category

    Technology

  • view

    5.592
  • download

    3

Embed Size (px)

description

 

Transcript of App extension for iOS

  • App Extension 2014/6/20 @TachibanaKaoru
  • Apple
  • Agenda About What is App Extension How to make App Extension How to share data Container and Extension App Group and Shared Container How to share codes between Container and Extension Information
  • About @TachibanaKaoru genesixVOYAGE GROUP iOS Blog : http://www.toyship.org/ WWDC2010
  • What is App Extension iOS8 Notication CenterWidget App Extension App Extension
  • What is App Extension App Extensions Today (iOS/OS X) Share (iOS/OS X) Action (iOS/OS X) Photo Editing (iOS) Finder (OS X) Storage Provider (iOS) Custom keyboard (iOS)
  • What is App Extension App Extensions Today (iOS/OS X) Share (iOS/OS X) Action (iOS/OS X) Photo Editing (iOS) Finder (OS X) Storage Provider (iOS) Custom keyboard (iOS)
  • What is App Extension App Extensions Today (iOS/OS X) Share (iOS/OS X) Action (iOS/OS X) Photo Editing (iOS) Finder (OS X) Storage Provider (iOS) Custom keyboard (iOS)
  • What is App Extension App Extensions Today (iOS/OS X) Share (iOS/OS X) Action (iOS/OS X) Photo Editing (iOS) Finder (OS X) Storage Provider (iOS) Custom keyboard (iOS)
  • What is App Extension App Extensions Today (iOS/OS X) Share (iOS/OS X) Action (iOS/OS X) Photo Editing (iOS) Finder (OS X) Storage Provider (iOS) Custom keyboard (iOS)
  • How to make App Extension Extension ExtensionContaining App
  • How to make App Extension ExtensionContaning Appipa ExtensionContaning App
  • How to make App Extension Containing App Extension Extension
  • How to make App Extension Extension info.plistExtension ViewController ViewController
  • How to make App Extension ExtensionContaining App Bundle Identier Containing AppExtensionBundle Identier Prex Containing App: org.toyship.chat Extension:org.toyship.chat.widget
  • How to make App Extension ExtensionAPI NS_EXTENSION_UNAVAILABLE_IOS + (UIApplication *)sharedApplication NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead."); ! @property(nonatomic,assign) id delegate; ! - (void)beginIgnoringInteractionEvents NS_EXTENSION_UNAVAILABLE_IOS(""); - (void)endIgnoringInteractionEvents NS_EXTENSION_UNAVAILABLE_IOS(""); - (BOOL)isIgnoringInteractionEvents; ! @property(nonatomic,getter=isIdleTimerDisabled) BOOL idleTimerDisabled; ! - (BOOL)openURL:(NSURL*)url NS_EXTENSION_UNAVAILABLE_IOS(""); - (BOOL)canOpenURL:(NSURL *)url NS_AVAILABLE_IOS(3_0);
  • How to make App Extension UIApplication.h + (UIApplication *)sharedApplication NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead."); ! @property(nonatomic,assign) id delegate; ! - (void)beginIgnoringInteractionEvents NS_EXTENSION_UNAVAILABLE_IOS(""); - (void)endIgnoringInteractionEvents NS_EXTENSION_UNAVAILABLE_IOS(""); - (BOOL)isIgnoringInteractionEvents; ! @property(nonatomic,getter=isIdleTimerDisabled) BOOL idleTimerDisabled; ! - (BOOL)openURL:(NSURL*)url NS_EXTENSION_UNAVAILABLE_IOS(""); - (BOOL)canOpenURL:(NSURL *)url NS_AVAILABLE_IOS(3_0);
  • How to make App Extension UIApplication-sharedApplication UIApplication-openURL UIViewControllerproperty NSExtensionContextExtension Host-Extension openURL
  • How to make App Extension NSExtensionContext @interface NSExtensionContext : NSObject ! // HostExtension @property(readonly, copy, NS_NONATOMIC_IOSONLY) NSArray *inputItems; ! // HostBlock UIViewController - (void)completeRequestReturningItems:(NSArray *)items completionHandler:(void(^)(BOOL expired))completionHandler; ! // Host - (void)cancelRequestWithError:(NSError *)error; ! // Asks the host to open an URL on the extension's behalf - (void)openURL:(NSURL *)URL completionHandler:(void (^)(BOOL success))completionHandler; ! @end
  • How to make App Extension NSExtensionContext
  • How to make App Extension ExtensionNSExtensionContextopenURL - (IBAction)openSomething:(id)sender { [self.extensionContext openURL:[NSURL URLWithString:@"http://www.apple.com/"] completionHandler:nil]; ! }
  • How to make App Extension - Today Today Extension UIViewController Storyboard
  • How to make App Extension - Today Today Extension Widget UIScrollView Today Extension touch/gesture
  • How to make App Extension - Share Share Extension SLComposeServiceViewC ontroller ShareDialog
  • How to make App Extension - Keyboard Custom Keyboard UIInputViewController ViewController
  • How to make App Extension - Keyboard UIInputViewController - (void)viewDidLoad { [super viewDidLoad]; // UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 0, 100, 100); [button addTarget:self action:@selector(inputSomething:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; // self.nextKeyboardButton = [UIButton buttonWithType:UIButtonTypeSystem]; [self.nextKeyboardButton setTitle:NSLocalizedString(@"Next Keyboard", @"Title for 'Next Keyboard' button") forState:UIControlStateNormal]; [self.nextKeyboardButton sizeToFit]; self.nextKeyboardButton.translatesAutoresizingMaskIntoConstraints = NO; [self.nextKeyboardButton addTarget:self action:@selector(advanceToNextInputMode) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.nextKeyboardButton]; }
  • How to make App Extension - Keyboard UIInputViewControllertextDocumentProxy -(void)inputSomething:(id)sender{ // [self.textDocumentProxy insertText:@" "]; }
  • How to share data Container and Extension Containing App Extension Keychain
  • How to share data Container and Extension Shared Container
  • App Group and Shared Container App Group iOS8 App GroupShared Container
  • App Group iOS Dev CenterGroup ID group.org.toyship.chatter Capability App Groupon iOS Dev CenterGroup ID Entitlement Container AppExtension
  • App Group and NSUserDefaults App GroupNSUserDafaultssharedDefaults NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.org.toyship.kaomoji"]; NSString* strValue = [sharedDefaults valueForKey:@"Neko"];
  • KeychainApp Group OS App Group8.0 App GroupNSUserDefaultsCoreData Keychain App Group
  • How to share codes between Container and Extension Containing AppExtension
  • How to share codes between Container and Extension Embedded Frameworks Container App Extension ExtensionEmbedded Frameworks
  • Information Extension
  • Information - NSLog ExtensionDebuggerAttach ProcessNSLog http://stackoverow.com/questions/24031612/how-to- debug-ios-8-extensions-with-nslog?rq=1 !
  • Information - Notify to users Extensionon Extension on/offExtension
  • Fin