I'm using Text(date, style: .timer) to display a timer in a WatchOS widget, which works great. The problem is that when the watchface goes dim the time goes from showing the time as "MM:SS" to showing "M minutes". Why is this occuring and how can I change the behavior? I understand it needs to remove seconds to preseve battery life, but why it is putting the word "minutes" at the end, this is messing up my layout. Thanks.
Posts under watchOS tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Dear all,
i am a music conductor and developer, and to fulfill my joy with music i recently developed a WatchFace and some apps for a non-apple watch called "PineTime".
My whole development is done in c++ and is available at
https://github.com/luto65/PineConductor/
Since I am aswell an apple developer, and most of my friends have apple watches, i am now porting those c++ apps to the apple watch.
I just finished the very first one, that is actually a watch Face
I now ported it to appleWatch and it looks pretty similar too (here a screenshot from the simulator)
I would like to now remove the annoying digital hour on the top right corner, and then sell it as new custom face, together with my other swift-ports of my original c++ applications.
Looking forward any feedback.
When using a double-tap primary action on a button, there will be a 1 second delay before the action is executed after the double-click is detected. Why is the design not like scrollview, which executes actions after double-tap detection? Is there a way to make the button perform an action after detecting a double-tap?
Can you initiate a live activity from a Watch app? From what I can tell you can only do it from an iOS app and then have the Watch mirror it, is that true?
If you were builiding a standalone timer app for WatchOS for instance and wanted the timer to show up automatically in Smart Stacks when the app is in the background, is this possible?
Thanks
I want to download some large files on watchOS and I found Apple Music app is able to download songs in background and pause downloading depending on battery life. Does there any way to do the same thing in my own app? After users choose to download, keep the downloading task in background and pause/resume on demand.
Im building a workout app to track swimming workouts for watchos 11. Triggering .prepare() on my HKWorkoutSession does not change the session state HKWorkoutSessionState.
Below is my prepare function which should transition the session state to HKWorkoutSessionStatePrepared. Nothing is thrown in the delegates, the state just wont change? I have tried erasing, restarting, use another version of xcode and another simulator runtime.
func prepare() {
guard self.session == nil else {
fatalError("Session already exist")
}
// Configure Workout Type
let config = HKWorkoutConfiguration()
config.activityType = .swimming
config.swimmingLocationType = .openWater
config.locationType = .outdoor
self.Workoutconfig = config
// Create Session
do {
guard store.authorizationStatus(for: .workoutType()) == .sharingAuthorized else {
fatalError("Lack of permission to start workout")
}
let session = try HKWorkoutSession(healthStore: store, configuration: config)
self.session = session
self.builder = session.associatedWorkoutBuilder()
Logger.diveController.info("Successfully created workout session")
builder?.dataSource = HKLiveWorkoutDataSource(healthStore: store, workoutConfiguration: config)
self.session?.delegate = self
self.builder?.delegate = self
if self.session == nil {
fatalError("No workout session created")
}
if self.builder == nil {
fatalError("No workout builder created")
}
self.session?.prepare()
logger.debug("Session Started at: \(self.session?.startDate ?? Date())")
logger.debug("Session State: \(self.session?.state.description ?? "")")
if self.session?.state != .prepared {
reset()
fatalError("Failed To Prepare")
}
} catch {
Logger.diveController.error("Error starting workout session: \(error.localizedDescription)")
}
}
Hi to all,
I'm new to WatchOS development and trying to enable the Developer Mode on my Apple Watch Series 7. I've enabled Developer Mode on my iPhone and did the same on my Apple Watch. After enabling Developer Mode on the watch it asks me to restart the watch. After a restart it asks me again if I want to enable Developer Mode. Of course! I don't succeed in installing the app on my watch because Xcode is "waiting for first unlock" of my watch. When I look in Settings > Privacy > Developer Mode the toggle switch is disabled. I can enable the switch but the watch asks me to restart and this is the loop I'm in.
Anybody suggestions for 'permanently enabling' Developer Mode on my Apple Watch?
Thanks in advance!
Hello everyone!
I want to add hand gesture controls to my Apple Watch app. Specifically, I’m looking to implement the following gestures:
1. Tapping index finger and thumb together once
2. Tapping index finger and thumb together twice
3. Fist clench
4. Double fist clench
Each gesture should trigger a different action within the app.
However, I can’t find any information on how to implement this. I only came across an example using .handGestureShortcut(.primaryAction) (Enabling the double-tap gesture on Apple Watch https://developer.apple.com/documentation/watchOS-Apps/enabling-double-tap), but I need to handle four distinct gestures.
Is this possible in watchOS 11? Any guidance or examples would be greatly appreciated!
Thank you!
I use onPreferenceChange() and onScrollPhaseChange() to detect scroll is triggered by double tap. Is there any way to directly know the scroll is triggered by double tap?
I use onPreferenceChange() and onScrollPhaseChange() to detect the scroll is triggered by double tap.
Is there any way to directly know that the scroll is triggered by a double tap?
Xcode Version 16.1 beta 3 (16B5029d) --
Watch Series 9 Version 11.1 (22R5569a) --
iPhone 16 Pro Version 18.1 (22B5069a)
The current WatchOS version has introduced a UI bug in NavigationView.navigationTitle - and I'm attempting to install a new version of my App on my Watch.
This watch was previously sync'd with an iPhone 13 Pro - which is no longer associated with my AppleID since I'm using my new iPhone 16 Pro.
The watch is paired with the 16 Pro, and in previous versions of Xcode 16.1, I was able to compile and run my all of my apps on the Watch.
In the current beta 3, instead I get a dialog box which states:
Connecting to Apple Watch
Xcode will continue when the operation completes.
and this dialog box persists until the timeout (which is several minutes).
Any help?
I'm scheduling local notifications on my WatchOS app, but they are always alerting exactly 13 seconds later than scheduled. I have read other users having the exact same issue but there is no solution anywhere. I'm not sure how one is supposed to write any sort of timer app when they are always coming in delayed. Any idea why this occurs and how to resolve it? For now I am subtracting 13 seconds from the end time, but that's not really a solution I'm happy with.
Thanks
I'm using Live Activity features in my app, but I want to customize the user experience across different Apple devices. Specifically, I'd like to:
Keep Live Activity enabled and functioning on the iPhone Disable or prevent Live Activity from appearing on the connected Apple Watch
Is this level of device-specific control possible with Live Activity? If so, what's the best approach to implement this functionality? What I've tried:
I've looked through Apple's documentation on Live Activity, but couldn't find specific information about device-level control. I've experimented with ActivityKit, but haven't found a clear way to distinguish between iPhone and Apple Watch when pushing updates.
I’ve developed an Apple Watch extension for an existing iOS app. When I run the app on the watch via Xcode using the simulator, everything works fine. However, when I try to install it on my iPhone, the Watch app doesn’t show it in the "Available Apps" list, so I can't install it on the watch.
The Apple Watch is connected to my iPhone, and I can see other apps available for installation without any issues.
I also created a brand new project with watchOS support to troubleshoot, but the same problem occurred.
Any ideas on how to resolve this?
I have an iPhone/iPad application for which there is no watchOS target and as such no separate Watch app. I do not have separate watchOS app icons included as well in Assets. However, an Apple Watch is supposed to receive push notifications for the application.
Do we as app developers need to provide watchOS app icons, with different resolutions as suggested by Apple in HIG, in app's Assets for the app logo to appear properly in the notification coming in watch, for both short look and long look? As of now, my app's icon appear pixelated in short look and I am not sure whether it is an app icon issue or because I did not include watchOS app icons in Assets.
The peripheral is initiating a passkey entry mechanism, IOS device is getting a pop up to enter the passkey but the WatchOS device is not displaying any pop-up.
Is there anything to be enabled from the watch side?
https://forums.developer.apple.com/forums/thread/685317
Having read the above discussion, I can add there’s one problematic exception on watchOS to the rule that .didBecomeActiveNotification is fired when the Control Center or any other overlay (such as a long-look notification) is dismissed. It’s when it’s dismissed not by the user, but just allowed to dsimiss itself after a period (as determined by Settings > Wake Duration).
This is a problem for any Watch workout app because when one of these overlays is covering the app, it’s considered by the system to be backgounded for purposes of applying the 15% avg CPU load over 60 seconds criteria for being terminated for using too much CPU in the background, so I have discovered.
In the case of these overlays covering an app, the app never gets a .didEnterBackgroundNotification call to know that it should attempt to reduce its activity, when the user presses the Side Button to show the Control Center, which is by design, as I understand it.
The app does get a .willResignActiveNotification when the Control Center covers it, but there is no corresponding .didBecomeActiveNotification when the system dismisses the Control Center after 2 minutes or so.
So if the app reduces its actvity in an attempt to reduce CPU load when covered by the Control Center overlay, it has no way to know it has become active again, in the special case of the Control Center timing out and being dismissed by the system.
What could be done to reduce the likelihood of the system terminating the app in this situation, and maintain the app's functionality and usability?
I want to get which button in AccessoryWidgetGroup was pressed in the Watch App, but I can't.
When I use Button(_:intent:), it works in Smart Stack, but it doesn't work in Complication Widget.
Using widgetURL(_:) always gets the URL of the first button.
Below is a snippet of the code I tried.
All codes can be found here.
struct MyWatchWidgetEntryView : View {
var entry: Provider.Entry
var body: some View {
AccessoryWidgetGroup("Widget Group") {
MyWatchWidgetEntryButton(intent: .init(id: "001", imageName: "star.fill"))
MyWatchWidgetEntryButton(intent: .init(id: "002", imageName: "heart.fill"))
MyWatchWidgetEntryButton(intent: .init(id: "003", imageName: "leaf.fill"))
}
}
}
//Button View
private struct MyWatchWidgetEntryButton: View {
@Environment(\.showsWidgetContainerBackground) var showsWidgetContainerBackground
let intent: MyAppIntent
var body: some View {
Button(intent: intent) {
ZStack {
if showsWidgetContainerBackground {
Color.black
} else {
AccessoryWidgetBackground()
}
VStack {
Image(systemName: intent.imageName)
.font(.headline)
Text(intent.id)
.font(.system(size: 10, weight: .bold))
}
}
}
.buttonStyle(.plain)
.widgetURL(URL(string: "widget://" + intent.id))
}
}
Does anyone know how to do this?
Thank you.
I started a thread stating the above and apparently I am not the only one to encounter this issue. My Apple Watch is the version 10 and I certainly didn't expect to have this problem. My older Apple Watch did have this same problem initially but after a few updated it stated working. I only tried the consumer beta hoping the issue was resolved. One of the posts today hoped the next update would fix it and I informed him I had installed the beta and it still wasn't working.
I’d like to migrate my watchOS app (bundled with an iOS app) from a dual-target to a single-target setup. I remember Xcode used to have a menu item (Editor -> Validate Settings) that would prompt you to initiate the migration process. However, I can’t seem to find a ‘Validate Settings’ option in the latest Xcode 16. Has "Validate Settings" been removed in xcode16 ?
Thanks!