Watch Complications

RSS for tag

Display timely and relevant information about your app on the Apple Watch face using Complications.

Posts under Watch Complications tag

166 Posts

Post

Replies

Boosts

Views

Activity

WidgetKit watch complication not shown on real device.
I updated my project from watch app + extension to single-execute project with Xcode 15. Then add a widget target to watch app. The new WidgetKit swiftUI complications works well on simulator, but not shown on the real device.(can not find on Apple Watch Face Complication Editor or rectangle widget) I tried: clean xcode build && Derived Data. reboot my watch/iphone delete all old clockkit complication settings & complicationcontroller.swift the watch still show old clockkit complicaton , that very buggy. so I try next: 4. restore my watch and pair it again. The new WidgetKit complication still not shown, it very frustrated. Do I have to change my old watch app to swiftUI lifecycle project to work? But code is works onthe simulator, which doesn't make sense. when I debug widget extension on Xcode, it show error: SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'hltek.***.watchkitapp.ComplicationWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo={NSLocalizedFailureReason=No widgets available to reload}}}}, FBSOpenApplicationRequestID=0x16e7}." UserInfo={NSUnderlyingError=0x15684f10 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo=0x1567e360 (not displayed)}}}, FBSOpenApplicationRequestID=0x16e7}}, NSLocalizedDescription=Failed to show Widget 'hltek.***.watchkitapp.ComplicationWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo={NSLocalizedFailureReason=No widgets available to reload}}}}, FBSOpenApplicationRequestID=0x16e7}.} Domain: DTXMessage Code: 1 User Info: { DVTErrorCreationDateKey = "2023-07-06 03:36:45 +0000"; } -- System Information macOS Version 13.4.1 (Build 22F2083) Xcode 15.0 (22221.2) (Build 15A5195k) Timestamp: 2023-07-06T11:36:45+08:00 dyld[459]: Symbol not found: _$s21DeveloperToolsSupport15PreviewRegistryPAAE7previewAA0D0VvgZ Referenced from: <E835EDE1-190A-33B0-9462-EFD25999365D> /private/var/containers/Bundle/Application/F2DE6431-DF97-472D-934F-B2B3F76E660E/*** WatchKit App.app/PlugIns/ComplicationWidgetExtension.appex/ComplicationWidgetExtension Expected in: <E4C8E0EA-CF6C-381C-877C-716427DD3DFB> /System/Library/Frameworks/DeveloperToolsSupport.framework/DeveloperToolsSupport debug the extension on simulator with no error.
2
1
2.0k
Jul ’23
Complications in WidgetKit - .accessoryCorner with curved text
Hello, I am trying out the new Watch Complications in WidgetKit and I am stuck on the widget '.accessoryCorner'. Unfortunately, I can't find a way to create a curved text as shown in the image in the upper left corner ('HON'). Using the '.widgetLabel' does insert a curved label in the second line, but the text above it in the first line remains horizontally arranged. Has anyone found a solution for this yet? Thanks for the help Thomas
9
4
6.5k
Jun ’23
WatchOS: tap action for watch face complication
I want to create interactive watch face widget in a way, so user can see some data from my app on the Watch Face widget and then tap on the widget (complication) to change the data without moving inside the app. Does it possible? Or after the tap user always will be moved inside my app? I saw interactive widgets was introduced for iOS and macOS on WWDC23 https://developer.apple.com/videos/play/wwdc2023/10028. But can smth like that be developed for WatchOS?
1
0
1.1k
Jun ’23
Connection to background transfer daemon interrupted/invalidated
Hi, I'm developing an independent WatchOS application, and trying to use background URL sessions to download new content for complication update. I think my download tasks are scheduled up appropriately, during a background refresh, following all documented guidelines from apple documentation. Everything seems to work as intended on the simulator. But when running on the real device (from XCode, using a self-signed certificate), the updates become quite unreliable (and the debug process is very frustrating btw). Most of the times, the scheduled download never finishes until the app returns to foreground. And I get the following error in the logs : BackgroundSession ... connection to background transfer daemon [interrupted | invalidated] I read that this might be due to a code signing issue. Does it mean that I have to register to an apple developer account to get it working on the real device ? (Needless to say that I'm not naturally inclined to subscribe while I'm not sure to get the app running as intended...) Thanks a lot for any help
2
0
2.8k
Jun ’23
Usage of "transferCurrentComplicationUserInfo" method in WidgetKit for WatchOS
I have a project on watchOS with Complications. Right now it works like this in ClockKit, when the app is not running on the watch, transferCurrentComplicationUserInfo method is utilized to manage the transfer of user information. This involves the ComplicationController being launched by the system, which then initiates the WCSession to receive data and update complications. My issue: How should I implement real-time update of complications transferCurrentComplicationUserInfo does not guarantee that my app will be launched by the system?
0
2
791
May ’23
watch app crashes when permissions for microphone and bluetooth are changed on iPhone
My watchOS app crashes when I accept/change the microphone or Bluetooth permission from its companion iOS app. It crashes with the following message in the console. Message from debugger: Terminated due to signal 9 Please let me know a way to identify and fix the exact problem. here are my device logs: Device logs and crash report
4
1
3.3k
May ’23
watchOS 9: ClockKit-based complications occasionally failed to display
Hello! Two of my watch apps (HiCoffee and HiWater) occasionally have issues with complications not displaying properly on watchOS 9. I did NOT use the new WidgetKit to implement the complications, all the related code still uses the same previous ClockKit + SwiftUI. I have observed several different types of wrong behaviors. One specific complication cannot be displayed (rendered?), while others do work (from the same app). This indicates that my watch app is working properly. All complications on the face cannot be displayed. But the app logs indicates it's running properly. In addition, when you long press the face to edit complications, yet it can be displayed normally. Log shows CLKComplicationServer.sharedInstance().activeComplications always returns 0 no matter how many complications are added to the face. Also, the ComplicationController is NOT called by system. I'm not using WatchKit. This part of the code in my app has been working properly for a long time and has not been changed. But after the release of watchOS 9, I received a lot of feedback from users with this problem. So I think the problem is in watchOS 9. I haven't found a way to reproduce the problem yet. Any suggestions please?
7
2
3.6k
May ’23
Complication support in watch OS 9 with ClockKit
Hi Team, I am using the ClockKit to populate my watch app compilations. I have not added the WidgetKit target yet. As Apple start showing warnings for the storyboard in the watch extension, I replaced the storyboard with SwiftUI classes So now my app UI is created from SwiftUI and Complications are from ClockKit But when the watch is upgraded to 9, there are a few issues coming up related to complications most of them are actually related to the timeline and complications are becoming unresponsive So whether Apple still support ClockKit ? or is it mandatory to move to WidgetKIt?
0
0
1.2k
May ’23
Watch Standalone App The icon is not displayed in the Watch app on iPhone.
Watch Standalone App The icon is not displayed in the Watch app on iPhone. We are currently trying to get the Apple Watch Standalone app to be judged. It has been rejected in the current review. The cause is that after installing the app on the watch, the app icon is displayed as a blank image in the "Installed on Apple Watch" item of the "Watch" app, which is the default app of the iPhone. The app icon installed on the watch cannot be displayed in the iPhone's default "Watch" app. If anyone knows of a possible way, please let us know. I've tried a lot of different ways now, but to no avail. Even if I combined the iPhone + watch icon in Watch Assets and installed the watch app, it failed. Even the Apple guidelines given by the reviewer have no relevant information at all.
0
0
943
May ’23
Info.plist location for Apple Watch app?
I'm a new developer and I'm trying to learn how to develop a very basic Apple Watch app (without an additional iOS app) that displays the user's current gps location, as part of a more complicated project. When it comes time to run the app, I get the following error: "This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an “NSLocationWhenInUseUsageDescription” key with a string value explaining to the user how the app uses this data" This was interesting for me because there is no info.plist file in my project, and it seems like the newer versions of Xcode don't automatically generate this file for you. So, I tried to create my own property list file, name it info.plist, and include the “NSLocationWhenInUseUsageDescription” key/value in it. Unfortunately, this did not do the trick. I'm assuming, because I'm a beginner, that this is a relatively easy fix. I will provide the my code for context below, any advice would be greatly appreciated, I'm a bit overwhelmed by all the information out there, and a lot of it seems outdated and not helpful to me. ContentView.swift import SwiftUI import CoreLocation struct ContentView: View { @StateObject private var locationManager = LocationManager() var body: some View { VStack { Text("Your Location") .font(.largeTitle) if let location = locationManager.currentLocation { Text("Latitude: \(location.coordinate.latitude)") Text("Longitude: \(location.coordinate.longitude)") } else { Text("Location not available") } } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } LocationManager.swift import Foundation import CoreLocation class LocationManager: NSObject, ObservableObject { @Published var currentLocation: CLLocation? private let locationManager = CLLocationManager() override init() { super.init() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } } extension LocationManager: CLLocationManagerDelegate { func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let location = locations.last else { return } currentLocation = location } } Screenshot of Info.plist (xcode changes it after I enter 'NSLocationWhenInUseUsageDescription')
3
0
3.7k
Apr ’23
WatchKit Complication Placeholders seem broken and unreliable
I am trying to add a complication to an existing Watch app, and need to use the ClockKit approach to be compatible with older watchOS versions. I've spent a couple days working on this and have concluded that using placeholder images through an asset catalog is not reliable at all. In fact it seems really broken. First issue, the documentation here has some inaccuracies relative to observed behavior: https://developer.apple.com/documentation/clockkit/creating_complications_for_your_watchos_app/adding_placeholders_for_your_complication?language=objc The documentation says "If you don’t provide any placeholders, the system generates a placeholder based on your app icon." which is not true in practice. If I do not provide placeholder images, the complication only shows "--". Pity, because all my customers really want is a shortcut to launch the app, so having the icon displayed in the complication would be wonderful. OK, so I'll provide some image placeholders in the Xcode assets. The documentation says "If you don’t provide an image for a particular screen size, watchOS resizes the closest available image in that family." Well that's not true either. I have to supply every size in every family or the complication shows "--" on some devices. Even that wouldn't be bad if it really worked. But in Xcode 14, the asset format for complication images only has slots for a few device sizes. So even when I fill all the slots, testing on some other device sizes results in "--" displayed in the complication because there isn't a direct placeholder graphic match for their screen size. Finally, different scale options can be set for the assets, and some offer options for "all sizes" or vector graphics. That would be wonderful since theoretically it can scale to any size and look sharp. Well I tried that with SVG files in the sizes requested, and the graphics show up but do not properly scale on the devices. They end up getting cropped, not scaled. Has anyone gotten this to work properly? It seems totally broken. I can certainly write up code to deliver complication graphics as part of the complication data source, but without reliable static placeholder graphics, that will still leave some undesirable gaps when a user first installs the app. I am really surprised this is so unreliable.
2
0
1.3k
Apr ’23
How can I apply the modify my Swift Chart based on the ComplicationRenderingMode
For Apple Watch complications displayed on tinted faced, developers can use: @Environment(\.complicationRenderingMode) var renderingMode to see if the watch face is tinted. You can then use the .complicationForeground() modifier to set elements of the complication to match that tint color. (I appreciate that .complicationForeground() is now deprecated in favour of .widgetAccentable() but I believe the behaviour is the same). However, this can only be applied to a view I believe. I'd like to display a Swift Chart where only certain elements of the chart have the .complicationForeground() rather than the whole chart. For example, in one case I'd like the LineMark to pop with the tinted color of the complication whilst the rest of the complication get the gray default tint. Is there a way to do with with the current APIs? Thanks
2
0
1.6k
Apr ’23
app for truckers on the apple watch ultra
Hi i'm a trucker since 12 years now and i recently bought an apple watch ultra and i find it that there not much apps dedicated for truckers like i see on the garmin brand of what they do with the instinct 2 dezl edition. What i mean is there an solution to have an app on the apple watch to have like an elog or something like that for a complication or just a nice new facewatch dedicated for trucker i hope i think i'm not alone in that situation. I'm not good on the programmation side on a computer so i'm asking if someone can do something about it
2
0
1.1k
Apr ’23
WidgetKit watch complication not shown on real device.
I updated my project from watch app + extension to single-execute project with Xcode 15. Then add a widget target to watch app. The new WidgetKit swiftUI complications works well on simulator, but not shown on the real device.(can not find on Apple Watch Face Complication Editor or rectangle widget) I tried: clean xcode build && Derived Data. reboot my watch/iphone delete all old clockkit complication settings & complicationcontroller.swift the watch still show old clockkit complicaton , that very buggy. so I try next: 4. restore my watch and pair it again. The new WidgetKit complication still not shown, it very frustrated. Do I have to change my old watch app to swiftUI lifecycle project to work? But code is works onthe simulator, which doesn't make sense. when I debug widget extension on Xcode, it show error: SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'hltek.***.watchkitapp.ComplicationWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo={NSLocalizedFailureReason=No widgets available to reload}}}}, FBSOpenApplicationRequestID=0x16e7}." UserInfo={NSUnderlyingError=0x15684f10 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo=0x1567e360 (not displayed)}}}, FBSOpenApplicationRequestID=0x16e7}}, NSLocalizedDescription=Failed to show Widget 'hltek.***.watchkitapp.ComplicationWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.Carousel" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (IOSSHLMainWorkspace) for reason: BadArgument., NSLocalizedDescription=The request to open "com.apple.Carousel" failed., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x15687310 {Error Domain=FBSOpenApplicationErrorDomain Code=2 "(null)" UserInfo={NSUnderlyingError=0x15696b00 {Error Domain=com.apple.Carousel.ComplicationExtensionDebuggingErrorDomain Code=3 "No widgets available to reload" UserInfo={NSLocalizedFailureReason=No widgets available to reload}}}}, FBSOpenApplicationRequestID=0x16e7}.} Domain: DTXMessage Code: 1 User Info: { DVTErrorCreationDateKey = "2023-07-06 03:36:45 +0000"; } -- System Information macOS Version 13.4.1 (Build 22F2083) Xcode 15.0 (22221.2) (Build 15A5195k) Timestamp: 2023-07-06T11:36:45+08:00 dyld[459]: Symbol not found: _$s21DeveloperToolsSupport15PreviewRegistryPAAE7previewAA0D0VvgZ Referenced from: <E835EDE1-190A-33B0-9462-EFD25999365D> /private/var/containers/Bundle/Application/F2DE6431-DF97-472D-934F-B2B3F76E660E/*** WatchKit App.app/PlugIns/ComplicationWidgetExtension.appex/ComplicationWidgetExtension Expected in: <E4C8E0EA-CF6C-381C-877C-716427DD3DFB> /System/Library/Frameworks/DeveloperToolsSupport.framework/DeveloperToolsSupport debug the extension on simulator with no error.
Replies
2
Boosts
1
Views
2.0k
Activity
Jul ’23
Complications in WidgetKit - .accessoryCorner with curved text
Hello, I am trying out the new Watch Complications in WidgetKit and I am stuck on the widget '.accessoryCorner'. Unfortunately, I can't find a way to create a curved text as shown in the image in the upper left corner ('HON'). Using the '.widgetLabel' does insert a curved label in the second line, but the text above it in the first line remains horizontally arranged. Has anyone found a solution for this yet? Thanks for the help Thomas
Replies
9
Boosts
4
Views
6.5k
Activity
Jun ’23
WatchOS: tap action for watch face complication
I want to create interactive watch face widget in a way, so user can see some data from my app on the Watch Face widget and then tap on the widget (complication) to change the data without moving inside the app. Does it possible? Or after the tap user always will be moved inside my app? I saw interactive widgets was introduced for iOS and macOS on WWDC23 https://developer.apple.com/videos/play/wwdc2023/10028. But can smth like that be developed for WatchOS?
Replies
1
Boosts
0
Views
1.1k
Activity
Jun ’23
Connection to background transfer daemon interrupted/invalidated
Hi, I'm developing an independent WatchOS application, and trying to use background URL sessions to download new content for complication update. I think my download tasks are scheduled up appropriately, during a background refresh, following all documented guidelines from apple documentation. Everything seems to work as intended on the simulator. But when running on the real device (from XCode, using a self-signed certificate), the updates become quite unreliable (and the debug process is very frustrating btw). Most of the times, the scheduled download never finishes until the app returns to foreground. And I get the following error in the logs : BackgroundSession ... connection to background transfer daemon [interrupted | invalidated] I read that this might be due to a code signing issue. Does it mean that I have to register to an apple developer account to get it working on the real device ? (Needless to say that I'm not naturally inclined to subscribe while I'm not sure to get the app running as intended...) Thanks a lot for any help
Replies
2
Boosts
0
Views
2.8k
Activity
Jun ’23
Usage of "transferCurrentComplicationUserInfo" method in WidgetKit for WatchOS
I have a project on watchOS with Complications. Right now it works like this in ClockKit, when the app is not running on the watch, transferCurrentComplicationUserInfo method is utilized to manage the transfer of user information. This involves the ComplicationController being launched by the system, which then initiates the WCSession to receive data and update complications. My issue: How should I implement real-time update of complications transferCurrentComplicationUserInfo does not guarantee that my app will be launched by the system?
Replies
0
Boosts
2
Views
791
Activity
May ’23
watch app crashes when permissions for microphone and bluetooth are changed on iPhone
My watchOS app crashes when I accept/change the microphone or Bluetooth permission from its companion iOS app. It crashes with the following message in the console. Message from debugger: Terminated due to signal 9 Please let me know a way to identify and fix the exact problem. here are my device logs: Device logs and crash report
Replies
4
Boosts
1
Views
3.3k
Activity
May ’23
watchOS 9: ClockKit-based complications occasionally failed to display
Hello! Two of my watch apps (HiCoffee and HiWater) occasionally have issues with complications not displaying properly on watchOS 9. I did NOT use the new WidgetKit to implement the complications, all the related code still uses the same previous ClockKit + SwiftUI. I have observed several different types of wrong behaviors. One specific complication cannot be displayed (rendered?), while others do work (from the same app). This indicates that my watch app is working properly. All complications on the face cannot be displayed. But the app logs indicates it's running properly. In addition, when you long press the face to edit complications, yet it can be displayed normally. Log shows CLKComplicationServer.sharedInstance().activeComplications always returns 0 no matter how many complications are added to the face. Also, the ComplicationController is NOT called by system. I'm not using WatchKit. This part of the code in my app has been working properly for a long time and has not been changed. But after the release of watchOS 9, I received a lot of feedback from users with this problem. So I think the problem is in watchOS 9. I haven't found a way to reproduce the problem yet. Any suggestions please?
Replies
7
Boosts
2
Views
3.6k
Activity
May ’23
Complication support in watch OS 9 with ClockKit
Hi Team, I am using the ClockKit to populate my watch app compilations. I have not added the WidgetKit target yet. As Apple start showing warnings for the storyboard in the watch extension, I replaced the storyboard with SwiftUI classes So now my app UI is created from SwiftUI and Complications are from ClockKit But when the watch is upgraded to 9, there are a few issues coming up related to complications most of them are actually related to the timeline and complications are becoming unresponsive So whether Apple still support ClockKit ? or is it mandatory to move to WidgetKIt?
Replies
0
Boosts
0
Views
1.2k
Activity
May ’23
Watch Standalone App The icon is not displayed in the Watch app on iPhone.
Watch Standalone App The icon is not displayed in the Watch app on iPhone. We are currently trying to get the Apple Watch Standalone app to be judged. It has been rejected in the current review. The cause is that after installing the app on the watch, the app icon is displayed as a blank image in the "Installed on Apple Watch" item of the "Watch" app, which is the default app of the iPhone. The app icon installed on the watch cannot be displayed in the iPhone's default "Watch" app. If anyone knows of a possible way, please let us know. I've tried a lot of different ways now, but to no avail. Even if I combined the iPhone + watch icon in Watch Assets and installed the watch app, it failed. Even the Apple guidelines given by the reviewer have no relevant information at all.
Replies
0
Boosts
0
Views
943
Activity
May ’23
Info.plist location for Apple Watch app?
I'm a new developer and I'm trying to learn how to develop a very basic Apple Watch app (without an additional iOS app) that displays the user's current gps location, as part of a more complicated project. When it comes time to run the app, I get the following error: "This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an “NSLocationWhenInUseUsageDescription” key with a string value explaining to the user how the app uses this data" This was interesting for me because there is no info.plist file in my project, and it seems like the newer versions of Xcode don't automatically generate this file for you. So, I tried to create my own property list file, name it info.plist, and include the “NSLocationWhenInUseUsageDescription” key/value in it. Unfortunately, this did not do the trick. I'm assuming, because I'm a beginner, that this is a relatively easy fix. I will provide the my code for context below, any advice would be greatly appreciated, I'm a bit overwhelmed by all the information out there, and a lot of it seems outdated and not helpful to me. ContentView.swift import SwiftUI import CoreLocation struct ContentView: View { @StateObject private var locationManager = LocationManager() var body: some View { VStack { Text("Your Location") .font(.largeTitle) if let location = locationManager.currentLocation { Text("Latitude: \(location.coordinate.latitude)") Text("Longitude: \(location.coordinate.longitude)") } else { Text("Location not available") } } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } LocationManager.swift import Foundation import CoreLocation class LocationManager: NSObject, ObservableObject { @Published var currentLocation: CLLocation? private let locationManager = CLLocationManager() override init() { super.init() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } } extension LocationManager: CLLocationManagerDelegate { func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let location = locations.last else { return } currentLocation = location } } Screenshot of Info.plist (xcode changes it after I enter 'NSLocationWhenInUseUsageDescription')
Replies
3
Boosts
0
Views
3.7k
Activity
Apr ’23
WatchKit Complication Placeholders seem broken and unreliable
I am trying to add a complication to an existing Watch app, and need to use the ClockKit approach to be compatible with older watchOS versions. I've spent a couple days working on this and have concluded that using placeholder images through an asset catalog is not reliable at all. In fact it seems really broken. First issue, the documentation here has some inaccuracies relative to observed behavior: https://developer.apple.com/documentation/clockkit/creating_complications_for_your_watchos_app/adding_placeholders_for_your_complication?language=objc The documentation says "If you don’t provide any placeholders, the system generates a placeholder based on your app icon." which is not true in practice. If I do not provide placeholder images, the complication only shows "--". Pity, because all my customers really want is a shortcut to launch the app, so having the icon displayed in the complication would be wonderful. OK, so I'll provide some image placeholders in the Xcode assets. The documentation says "If you don’t provide an image for a particular screen size, watchOS resizes the closest available image in that family." Well that's not true either. I have to supply every size in every family or the complication shows "--" on some devices. Even that wouldn't be bad if it really worked. But in Xcode 14, the asset format for complication images only has slots for a few device sizes. So even when I fill all the slots, testing on some other device sizes results in "--" displayed in the complication because there isn't a direct placeholder graphic match for their screen size. Finally, different scale options can be set for the assets, and some offer options for "all sizes" or vector graphics. That would be wonderful since theoretically it can scale to any size and look sharp. Well I tried that with SVG files in the sizes requested, and the graphics show up but do not properly scale on the devices. They end up getting cropped, not scaled. Has anyone gotten this to work properly? It seems totally broken. I can certainly write up code to deliver complication graphics as part of the complication data source, but without reliable static placeholder graphics, that will still leave some undesirable gaps when a user first installs the app. I am really surprised this is so unreliable.
Replies
2
Boosts
0
Views
1.3k
Activity
Apr ’23
How can I apply the modify my Swift Chart based on the ComplicationRenderingMode
For Apple Watch complications displayed on tinted faced, developers can use: @Environment(\.complicationRenderingMode) var renderingMode to see if the watch face is tinted. You can then use the .complicationForeground() modifier to set elements of the complication to match that tint color. (I appreciate that .complicationForeground() is now deprecated in favour of .widgetAccentable() but I believe the behaviour is the same). However, this can only be applied to a view I believe. I'd like to display a Swift Chart where only certain elements of the chart have the .complicationForeground() rather than the whole chart. For example, in one case I'd like the LineMark to pop with the tinted color of the complication whilst the rest of the complication get the gray default tint. Is there a way to do with with the current APIs? Thanks
Replies
2
Boosts
0
Views
1.6k
Activity
Apr ’23
app for truckers on the apple watch ultra
Hi i'm a trucker since 12 years now and i recently bought an apple watch ultra and i find it that there not much apps dedicated for truckers like i see on the garmin brand of what they do with the instinct 2 dezl edition. What i mean is there an solution to have an app on the apple watch to have like an elog or something like that for a complication or just a nice new facewatch dedicated for trucker i hope i think i'm not alone in that situation. I'm not good on the programmation side on a computer so i'm asking if someone can do something about it
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’23