Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class func openParentApplication(userInfo: [NSObject : AnyObject], reply: (([NSObject : AnyObject], NSError?) -> Void)?) -> Bool
- func updateInformationToParentApp(emergencyInfo : [NSObject : AnyObject]!){
- // Call the parent application from Apple Watch
- WKInterfaceController.openParentApplication(emergencyInfo) { (returnUpdate, error) -> Void in
- if((error) == nil){
- print("Data send successfully");
- }else{
- print("Error : (error?.localizedDescription)");
- }
- }
- }
- func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: ([NSObject : AnyObject]?) -> Void){
- NSLog("Handler Apple Watch Event ");
- watchEvent(userInfo, reply: reply);
- }
- func watchEvent(userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!) ->Void)!) {
- let dic = userInfo as NSDictionary;
- NSLog("dic %@", dic);
- // retrieved parameters from Apple Watch
- print(userInfo["Key"])
- //Perform Segue from Here according to Dictionary Info
- // pass back values to Apple Watch
- var returnUpdate = Dictionary<String,AnyObject>()
- let watchAppMessage = "Meesage Back To Apple Watch" as NSString;
- returnUpdate["message"] = NSKeyedArchiver.archivedDataWithRootObject(watchAppMessage);
- reply(returnUpdate)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement