Last active
October 2, 2015 15:57
-
-
Save Eluss/2f0c64a042b9c3b2fd1a to your computer and use it in GitHub Desktop.
openParentApplication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func buttonAction() { | |
let dictionary = ["message": "Hi, apple watch here!"] | |
WKInterfaceController.openParentApplication(dictionary) { | |
(replyInfo, error) -> Void in | |
let reply = replyInfo["event"] as! NSData // take our encoded event from dictionary | |
NSKeyedUnarchiver.setClass(Event.self, forClassName: "Event") // We are not using original class anymore, so we have to do it | |
let event = NSKeyedUnarchiver.unarchiveObjectWithData(reply) // decode the event | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment