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

What's new in Watch OS 2: Three different ways of iphone-watch interconnectivity

What's new in Watch OS 2: Three different ways of iphone-watch interconnectivity

In this talk on a very basic example app (grabbing event timeline from dou.ua via import.io) watch os 2 feature called "complications" is explained. Described three ways of interconnectivity between devices operating iOS / Watch OS / Watch OS 2

Petro Korienev

January 21, 2016
Tweet

More Decks by Petro Korienev

Other Decks in Programming

Transcript

  1. Petro Korienev iOS Engineer What’s new in WatchOS 2. Three

    different ways of iphone-watch interconnectivity
  2. The task Well, go grab some data from a backend

    Сache it Show inside UITableView And we need a Watch App!
  3. Well, let’s go step by step 1. Create XCode project

    2. Setup backend (import.io) 3. Create entity classes 4. Setup CoreData 5. AFNetworking 6. SDWebImage 7. UI 8. …
  4. Recall WWDC videos and… 1. Setup Application groups 2. Add

    correct entitlements 3. Use containerURLForSecurityApplicationGroupIdentifier: 4. Save in host 5. Fetch in watch 6. Empty :( 7. Compare store URLs 8. Read the docs and facepalm
  5. Network self.sessionManager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:@"https://api.import.io"]]; [self.sessionManager GET:path parameters:nil

    success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) { [[CoreDataManager sharedInstance] parseAndStorePage:weakSelf.currentPage withObjects:responseObject[@"results"]]; On watch
  6. Links Project - https://github.com/soxjke/WatchOSEventTimeline Watch OS 2 transitioning guide -

    https://developer.apple.com/ library/watchos/documentation/General/Conceptual/ AppleWatch2TransitionGuide/index.html#//apple_ref/doc/uid/ TP40015234-CH2-SW1 import.io - https://www.import.io