Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Practical WatchKit Development (CocoaHeads 04/2015)

Practical WatchKit Development (CocoaHeads 04/2015)

Presentation at the April 2015 CocoaHeads meeting in Berlin http://www.meetup.com/Cocoaheads-Berlin/events/221308573/

Claus Höfele

April 15, 2015
Tweet

More Decks by Claus Höfele

Other Decks in Technology

Transcript

  1. class TripDetailInterfaceController: WKInterfaceController { @IBOutlet private weak var map: WKInterfaceMap!

    override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) ... } override func willActivate() { super.willActivate() ... } }
  2. private func callParentApp() { let userInfo = ["input": "data"] WKInterfaceController.openParentApplication(userInfo)

    { replyInfo, error in println("reply \(replyInfo)") } } func application(application: UIApplication!, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!) -> Void)!)
  3. let defaults = NSUserDefaults(suiteName: "group.com.claushoefele.T")! func updateObjectForKey<T: NSCoding>(key: String, item:

    T) { let data = NSKeyedArchiver.archivedDataWithRootObject(item) defaults.setObject(data, forKey: key) }
  4. “Anything that could show the user a progress spinner (however

    briefly) is a failure on my part.” –David Smith
  5. “Does a wearable mean data intrudes even more into your

    life, or do the constraints (screen size etc) act as a filter to reduce overload?” –Bendict Evans