Questions tagged [watchkit]

WatchKit is an integral part of the Apple Watch experience for third-party applications. It contains the classes for creating Apple Watch applications and it ensures that an Apple Watch application can talk to its corresponding WatchKit extension.

WatchKit allows iOS developers to create rich, third-party app extensions with actionable items and notifications for the Apple Watch, as they've built apps for the iPhone and iPad.

More information on WatchKit:

3223 questions
12
votes
3 answers

Launch host app from watch app

I know that the openParentApplication api in watch kit extension can open the host app in the background but not in the foreground. I also tried using openUrl() api of NSExtensionContext as below: NSExtensionContext *ctx = [[NSExtensionContext…
Ganesh Nayak
  • 802
  • 11
  • 38
12
votes
1 answer

How to get title from WKInterfaceButton

To get title there is function: setTitle But how to get title of WKInterfaceButton as string ? I did not found anything in https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceButton_class/index.html
WebOrCode
  • 6,852
  • 9
  • 43
  • 70
11
votes
1 answer

How to migrate Watch app to SwiftUI Lifecycle

I have an iOS app with a Apple Watch extension. I downloaded Xcode 14 and have the warning: WatchKit storyboards are deprecated in watchOS 7.0 and later. Please migrate to SwiftUI and the SwiftUI Lifecycle. I'm all for this migration, in fact, my…
fphelp
  • 1,544
  • 1
  • 15
  • 34
11
votes
1 answer

Core data + CloudKit - sharing between iOS and watchOS companion app

In my app I store data with core data. Recently I discovered the new feature introduced by Apple in WWDC19 which allows core data to work with CloudKit. I just enabled cloudKit for my app and used an NSPersistentCloudKitContainer instead of…
Cydiaddict
  • 277
  • 4
  • 17
11
votes
3 answers

"The Internet connection appears to be offline" when making URLSession requests on Apple Watch using LTE

Bug: I'm consistently getting error code -1009 "The Internet connection appears to be offline." errors when making URLSession requests in an Apple Watch extension on an Apple Watch Series 3 when connected to the Internet only via LTE. Steps to…
jaredsinclair
  • 12,687
  • 5
  • 35
  • 56
11
votes
0 answers

What's the best way to sync authentication data between iOS and watchOS?

I've having issues synchronizing user credentials between iOS and watchOS. My basic set up is that my iOS app and watchOS app both need to talk to a backend server, and they both need an access token to do so. However, the user can only sign in on…
11
votes
2 answers

How to change font size of label Apple Watch

I'm kind of stunned I even have to ask this question, but how is it possible to change the size of a label's text on the Apple watch? It doesn't allow changing the size in the Xcode UI, I haven't been able to do it programmatically, and the…
123
  • 8,733
  • 14
  • 57
  • 99
11
votes
1 answer

How to `addQuantitiesFromSamples` in HealthKit?

Building a HealthKit/WatchKit app based off WWDC 2015 - Session 203. There is no source code so I am writing it on the fly. There is a method I am having difficulty with since they don't discuss it. Luckily it's the same addQuantitiesFromSamples…
Edison
  • 11,881
  • 5
  • 42
  • 50
11
votes
6 answers

How to Test Scenario Where the Apple Watch Is Not Connected to an iPhone

I am developing a watchOS extension which uses WCSession to communicate with the iPhone. However, I do not own an Apple Watch and therefore have to rely on the Watch Simulator to test my code. Is there a way to test the scenario where the Watch is…
fabian789
  • 8,348
  • 4
  • 45
  • 91
11
votes
2 answers

Complication freezes Apple Watch when customizing

i am trying to create complication for watchOS2. I have created new target for my iOS application - with Glances and Complications I want to have only one Modular Large Complication. When I run trying to set complication Watch freezes (on both…
matejOS
  • 379
  • 2
  • 9
11
votes
3 answers

How to transfer a UIImage using Watch Connectivity

How can I transfer an UIImage over WatchConnecitivity from the iPhone to the Apple Watch with no user interaction on the phone, and only loads because the watch calls for it programmatically. I need this because the image processing to create the…
modesitt
  • 7,052
  • 2
  • 34
  • 64
11
votes
2 answers

How to reference non-supported frameworks in Watch OS 2

I updated my app to the latest swift 2.0 syntax. In doing so, My watchkit app has become broken. The issue is the watchkit app references a class that references the framework AVFoundation. WatchOS2 apparently now no longer supports some of the…
modesitt
  • 7,052
  • 2
  • 34
  • 64
11
votes
1 answer

Can a real iOS device and Watch Simulator communicate for Testing purposes

I want to create a watch app for an existing iOS app. But I am in a situation that i don't own a apple watch and my existing iOS app will run only on real devices not on simulator. Is it possible to run the app on the iphone device and test my watch…
ipraba
  • 16,485
  • 4
  • 59
  • 58
11
votes
5 answers

Using watch crown to control a WKInterfaceSlider

I would like to use the apple watch crown to control a slider. Is this possible? If so, how? Apple uses it to change the colours on the UI of the watch. EDIT: so it seems not possible at the moment (see answers below). Is important to notice that in…
mm24
  • 9,280
  • 12
  • 75
  • 170
11
votes
3 answers

Why does method rowControllerAtIndex of WKInterfaceTable return nil?

When I run the code below, the method rowControllerAtIndex of WKInterfaceTable returns nil. [self.outletTable setNumberOfRows:numberOfCategoriesToShow withRowType:@"rowTypeLabel"]; RowControllerTypeLabel *theRow = [self.outletTable…
John
  • 8,468
  • 5
  • 36
  • 61