Posts

Post not yet marked as solved
2 Replies
1.2k Views
I'd like to override the style of the widget so that my user's preference of dark mode in the app can also apply in the widget. In the main SwiftUI app I can use: SceneDelegate.shared?.window!.overrideUserInterfaceStyle = .dark But I'm not sure how to use that within the Widget extension. Yes I could define alternative for every single color and piece of text, but even things like the widget system background change with light/dark mode all of which I've have to try to check for and adjust. If I can override the user interface style, my widget would adjust automatically.
Posted Last updated
.
Post not yet marked as solved
6 Replies
1.1k Views
I've been unable to generate a complication bundle for my iOS and Apple Watch app with the latest Xcode 12 Beta 6 version. I consistently get the error in the title with the following: 2020-09-15 16:58:51.203 clockkitutil[3685:143736] generating gallery complication bundle for (null) at /Users/simon/Documents/gallery.ckcomplication I've tried this on my own project and I've also downloaded the Apple Sample Coffee Tracker WatchKit app which also exhibits the same problems. Any help or suggestions? Is this a bug?
Posted Last updated
.
Post marked as solved
1 Replies
815 Views
https://developer.apple.com/design/resources/ When I access the above link and scroll down to Add Apple Watch Face and select download, I get redirected to an odd AppleConnect page with some reference to box.com Other resources seem to work fine, am I doing something wrong? I've tried this on Safari and Chrome and signed into and out of my Apple Developer Account
Posted Last updated
.
Post marked as solved
2 Replies
1k Views
I'm trying to set the list row background color in my WatchOS app. I support WatchOS 6.2 & 7. The app is fully SwiftUI. I currently use listRowPlatterColor. I note that this has been deprecated in WatchOS 7 (although it does still work). My issue is with WatchOS 6.2 building from Xcode 12 Beta 6. Everything I run on a simulator or device with WatchOS 6.2 I get a crash: EXCBADACCESS If I remove any instances of listRowPlatterColor, the crash doesn't occur. Why does something that's been deprecated in WatchOS 7 still work there, but not in WatchOS 6? // Example code crashes on WatchOS 6.2 but not 7 // When building and running from Xcode 12 beta 6 struct TestView: View {     var body: some View {         List { Text("Hellow World)" .listRowPlatterColor(.clear) } } }
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
I'm unable to achieve anything like the font size used in the stock templates when trying to create a Circular Gauge in Swift UI. Here is my code for simply displaying three labels. The maximum value label ("101") clips. I can't set a minimumFontScaleFactor on the Text because it's not a proper view. Here is my current code: struct GaugeSample: View {     var body: some View {         Gauge(value: currentHR, in: minHR...maxHR) {             Image(systemName: "heart.fill")         } currentValueLabel: {             Text("66").complicationForeground()         } minimumValueLabel: {             Text("59")         } maximumValueLabel: {             Text("101")         }         .gaugeStyle(CircularGaugeStyle(tint: Gradient(colors: getGradientColors())))     } If I just use a previous style complication like this I get the full size text fonts: let template = CLKComplicationTemplateGraphicCircularOpenGaugeRangeText()  template.centerTextProvider = CLKSimpleTextProvider(text: "99") template.leadingTextProvider = CLKSimpleTextProvider(text: "40") template.trailingTextProvider = CLKSimpleTextProvider(text: "120") template.gaugeProvider = CLKSimpleGaugeProvider(style: .ring, gaugeColors: [UIColor.blue,UIColor.red], gaugeColorLocations: [0.3,0.9], fillFraction: 0.4) But I want to use the new SwiftUI complications so I can better customize for things like the rendering mode. Any suggestions?
Posted Last updated
.
Post marked as solved
1 Replies
1.1k Views
I'm trying to get the individual voltage measurements of an ECG back from Apple HealthKit using new APIs in iOS 14. I've already managed to use: let ecgQuery = HKSampleQuery(sampleType: HKObjectType.electrocardiogramType(), predicate: samplePredicate, limit: 0, sortDescriptors: [sortDescriptor]){ (query, results, error) in which gets me a HKElectrocardiogram object. From this I can see the average heart rate, ECG classification etc... I now believe I need to pass that object into an HKElectrocardiogramQuery like this:let ecgSample = HKElectrocardiogramQuery(ecg) { (query, result) in but I can't find any way to extract data from the result data handler. If I put a print in on result, it executes many times but again, I can't extract the data. result is of type HKElectrocardiogramQuery.Result The documentations pretty sketchy on Apple's developer site with zero examples provided. Any help would be very appreciated. Cheers
Posted Last updated
.