Questions tagged [apple-watch]

The Apple Watch is a smartwatch that was announced by Apple on September 9, 2014, with first deliveries in April 2015. Its third-party API, WatchKit, was released in November 2014. Use this tag for questions relating to Apple Watch hardware. For software questions, use the [watchkit] tag.

The Apple Watch is a smartwatch that designed to work with iPhones running iOS 8 or later (except for the iPhone 4s – iPhone 5 and later only). It features a "Digital Crown" as a novel input mechanism and comes in aluminum, stainless steel, and 18-karat gold variations.

The watch uses the WatchKit framework for development and presumably runs on an iOS variant.

Apps are meant to be lightweight and companions to their iPhone app counterparts, rather than replacements. They can be either Glances (obsolete since watchOS 3), which offer up timely information in a readable format, or full-fledged Watch Apps.

Watch Apps can be either hierarchical or page-based, and use a grid-based layout system as opposed to iOS's standard Auto Layout system.

Apple is focusing on these key areas:

Resources:

Samples:

2380 questions
31
votes
3 answers

How to hide API keys in GitHub for iOS (SWIFT) projects?

Hello I'm trying to publish a iOS (SWIFT) personal project in GitHub but I'm afraid of sharing my private API keys and secrets with everybody. I'm using parse so I have in my AppDelegate something like this: let applicationId =…
Manuel Martín
  • 338
  • 4
  • 8
30
votes
5 answers

Passing data to Apple Watch app

I am trying to pass data from my app into my Apple Watch app. Basically, I am using the same method as I used for creating the today widget and so I am passing data through NSUserDefaults. The problem is, that when I run my app, the data does not…
user3746428
  • 11,047
  • 20
  • 81
  • 137
28
votes
3 answers

Xcode - Error launching WatchKit Extension

I've successfully built a basic Watch/iPhone app and am getting the following error when trying to run on my devices: "Error Launching 'app_name WatchKit Extension' The operation couldn’t be completed. Unable to launch because it has an invalid code…
Bryan
  • 753
  • 1
  • 6
  • 12
27
votes
4 answers

Watch os 2.0 beta: access heart beat rate

With Watch OS 2.0 developers are supposed to be allowed to access heart beat sensors.... I would love to play a bit with it and build a simple prototype for an idea I have, but I can't find anywhere info or documentation about this feature. Can…
Sr.Richie
  • 5,680
  • 5
  • 38
  • 62
26
votes
1 answer

Apple Sample Code for WatchKit Extension Background Refresh

I've been searching for the answer to this question for quite a long time, so I think I'm willing to risk some downvotes to post it. Basically, I want to make the Apple provided sample code for Apple Watch background refresh actually work (link…
PerpetualStudent
  • 822
  • 9
  • 17
26
votes
5 answers

WatchKit API for Force Touch / Digital Crown?

I'm very excited about the new user interaction possibilities introduced by the Apple Watch, among them, Force Touch and Digital Crown. However, I couldn't find mentions of them in the WatchKit API. Are there any ways to receive events from Force…
zavié
  • 4,301
  • 2
  • 34
  • 46
25
votes
3 answers

Using environmentObject in watchOS

I am trying to use environmentObject in a watchOS6 app to bind my data model to my view. I have created a simple, stand-alone Watch app in Xcode 11. I created a new DataModel class import Combine import Foundation import SwiftUI final class…
Paulw11
  • 108,386
  • 14
  • 159
  • 186
24
votes
3 answers

WatchOS: Should UI updates from the extension be called on the main thread?

For iOS apps, UI updating is done from the main thread exclusively - not doing so is never recommended and can lead to unexpected behaviour. In watchOS, the OS is structured with a watch extension, and an app - as different 'containers'. Usually, UI…
Jordan Smith
  • 10,310
  • 7
  • 68
  • 114
24
votes
5 answers

How to check whether iPhone and apple watch are connected

Is there any way to notify user in Apple Watch that the iPhone is now out of range and when it comes back in range. How can we do it in watch extension. Thanks in advance.
Mohit Totlani
  • 825
  • 1
  • 10
  • 21
24
votes
6 answers

How can I simulate the Apple Watch for development purposes?

I just downloaded the Xcode 6 GM, and I'd like to see how my apps work with an Apple Watch connected to the simulated iPhone. How can I simulate this new device on my MacBook?
Undo
  • 25,519
  • 37
  • 106
  • 129
23
votes
17 answers

WatchKit error - unable to find interface controller class '' to instantiate

Whenever I make any connections in my subclass of WKIInterfaceController I get error WatchKit error - unable to find interface controller class 'myClass' to instantiate and a activity indicator showing in simulator and the view does not load.…
JSA986
  • 5,870
  • 9
  • 45
  • 91
22
votes
2 answers

Detect user's watchOS version from iOS app

I have an iOS app where I have some settings in the iOS app related to the watch. I only want to show them if the user has an Apple Watch that's compatible with my app. In WatchConnectivity I can query WCSession's isPaired property to see if the…
Stephen
  • 1,427
  • 1
  • 17
  • 42
22
votes
2 answers

What is the flow for updating complication data for Apple Watch?

I've been following a lot of tutorials on the internet to learn how to set up the complication. I have no problem getting the complication set up as expected. Until the initial timeline entries expire. After 12 hours, I do not know how to update it…
swiftyboi
  • 2,965
  • 4
  • 25
  • 52
21
votes
6 answers

Prevent Xcode from preparing Apple Watch when running for iOS

I have an iOS app that I want to test on my personal iOS device. I also wear an Apple Watch that's connected normally to this iPhone. I have not knowingly created any kind of Apple Watch target or code in my Xcode project. I do not want to run or…
pkamb
  • 33,281
  • 23
  • 160
  • 191
21
votes
2 answers

How to get Apple Watch UDID without Xcode?

I want to get my teams Apple Watch UDIDs for register devices in provisioning portal. but, my team members don't have Xcode.(not engineer)
kyubuns
  • 345
  • 1
  • 2
  • 8