Coding Explorer Blog

Exploring how to code for iOS in Swift and Objective-C

  • Home
  • Apps
  • About
  • Contact

Archives for February 2016

Watch Connectivity in Swift — Application Context

Xcode 11.6 Swift 5.2.4

Last updated on August 12, 2020

In the age of watchOS 1, the watchKit extension was on the paired iOS device, making sharing data between it and the main iOS app easy.  For the simplest of data, like preferences, we could just use NSUserDefaults with App Groups functionality.  We still should use that when sharing data between other extensions that still remain on the phone, like today view extensions, but not for watchOS apps anymore.

Luckily, Apple gave us a new API to use, that is significantly more robust than piggy-backing on App Groups, Watch Connectivity.  Watch Connectivity gives a lot more information about the status of the connection between your Apple Watch and its paired iPhone.  It also allows interactive messaging between the iOS App and the watchOS app, as well as background transfers that come in 3 flavors.  Those flavors are:

  1. Application Context
  2. User Info Transfer
  3. File Transfer

Today we will be talking about the first one, Application Context.
[Read more…]

Filed Under: Swift

Subscribe to the Coding Explorer Newsletter

* indicates required

Follow Us

Facebooktwitterrss

Recent Posts

  • Error Handling in Swift
  • Creating and Modifying a URL in your Swift App
  • Watch Connectivity in Swift — Application Context
  • watchOS Hello World App in Swift
  • API Availability Checking in Swift

Categories

  • Class Reference
  • General
  • Interface Builder
  • My Apps
  • Objective-C
  • Swift
  • Syntax
  • Tutorial
  • Uncategorized

Archives

  • May 2016
  • March 2016
  • February 2016
  • December 2015
  • July 2015
  • June 2015
  • April 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • January 2014
  • November 2013
  • September 2013
  • August 2013
  • July 2013
  • Terms Of Use
  • Privacy Policy
  • Affiliate Disclaimer

Subscribe to the Coding Explorer Newsletter

* indicates required

Copyright © 2025 Wayne Media LLC · Powered by Genesis Framework · WordPress