If you follow the Setup instructions below you’ll be able to access the SharedData.sharedInstance singleton from both the Watch Extension and in the App project files and be able to access the same data stored in Core Data and NSUserDefaults from the App and the Extension.
Tag Archives: iWatch API
So, let’s say we have an app that needs to remember a few simple things that the user puts in when they first load the app. It needs to remember the user’s name and birthday, to show on some view controller, or maybe even for a countdown on their Apple Watch.
There are plenty of ways to save data for your app. Some are easy to use, but rather limited, while others are much harder to use, but give you a lot more capabilities. Today, we are going to cover something on the easy, but limited end of the spectrum. For the app mentioned above, the information we’re storing will be used to set this app up with default values, for this user anyway.
That is why this method is called NSUserDefaults. It has its limitations, but it is very easy to use, and is ideal for simple storage of things like Strings and numbers.
I anticipate that many Apple Watch Apps will have some sort of countdown timer. It might be to show the time until some waiting component of a game is complete, or to countdown to a special date. Either way, it sure would be nice to have something built in to do that.
That is why Apple added the WKInterfaceTimer. Before this, you would probably have to use a normal label, and then periodically update it by being triggered by an NSTimer. I haven’t done this yet, so please let me know if there is a better way for me to mention here. Nonetheless, without some fancy third-party framework, replicating the capabilities of WKInterfaceTimer was probably significantly harder.
On Tuesday, November 18, 2014, Apple released the first beta of WatchKit, with the beta of Xcode 6.2. A few people might remember me saying that I wanted to stick with the release versions of Xcode, and not deal with beta releases. Well, when I posted that, the iWatch was only a rumor (and was referred to with that term, instead of it’s actual name, the Watch), and WatchKit wasn’t even mentioned. In other words, I am making an exception for WatchKit. Who knows, maybe I’ll take down the whole thing later if the next betas are fancy enough (especially with WatchKit). Click to Read>>
It’s here. The newest family of iOS is now available for developers: Watchkit. We are going to skip the dancing and get straight to the point. This post will help you get started with developing for apple watch by giving you a nice overview of what to expect. Let’s dive in! Original Post>>
This release of Xcode & pre-release version of the complete Xcode developer toolset for Mac, iPhone, iPad, and Apple Watch. This release requires OS X Yosemite or OS X Mavericks. Original Post>>