Making Network Requests on Apple Watch
Fortunately, networking on watchOS is incredibly easy. In traditional Apple fashion, “it just works.” We can use the NSURLSession class to make network requests, download files in the background, and upload files. If you want to use a third-party networking library, such as AFNetworking or Alamofire, you can use them just as on iOS, so long as they use NSURLSession and not its predecessor, NSURLConnection.[8] One thing that’s transparent to us as watchOS app developers is the actual device used to perform network requests. If the watch’s paired iPhone is connected, NSURLSession connections will use the iPhone as a proxy. Otherwise, the watch will connect to known Wi-Fi networks and perform the request itself. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access