Post not yet marked as solved
I’m having an issue with an app I’ve developed where it grinds to a halt and freezes when using the TabView with a certain iOS Setting enabled.
To simplify things, I can easily reproduce this with a demo project.
Launch Xcode 12.5, start a new iOS project with swift, swiftUI lifecycle and SwiftUI interface. Then replace the Text code in the content view body with ithe following simple code:
TabView {
Text("Hello, world! Tab 1")
.tabItem {
Label("Tab 1", systemImage: "list.dash")
}
Text("Tab 2")
.tabItem {
Label("Tab 2", systemImage: "list.dash")
}
}
If you launch and run this on device or on the simulator, it all works fine. You can click between the tabs etc…
However, if you navigate to the iPhone settings (and this is available in the simulator) and go Accessibility -> Keyboards -> Full Keyboard Access and toggle this ON, it causes a problem.
When re-opening the app we just made, as soon as you select a tab at the bottom, the app CPU usage jumps to 100%+ and grinds to a halt. The only fix is to force quite the app, but the issue persists on re-launches until you disable Full Keyboard Access.
Is this a bug? Or am I missing something? It seems to have been around throughout iOS 14’s life time.
Thank you
Post not yet marked as solved
Classically, the demo in the Meet WidgetKit video used a Calendar as an example, where clearly the times to update are simple to calculate based on when the users events will occur.
I'd like to know about the Activity/Fitness Widget. There's no way to tell when a user will burn that next calorie and as far as I can tell, there's still no background observer in HealthKit you can use to call an update on changes. So, with that in mind, how often should I call to update?
This same dilemma applies to ClockKit and WatchOS complications.
Post not yet marked as solved
I've implemented the steps in the WWDC 2020 Video "Meet Watch Face Sharing" and have managed to add into my app the ability to press a button to add a watch face. This then launches the Apple Watch app showing my complications, but when I then press add, it says Complication not available on your Apple Watch.
I have a Series 5 paired so all faces should be available, I've even implemented a fallback face but that hasn't helped.
In the end all it does is add a blank face to the watch.
Any suggestions?
Post not yet marked as solved
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.
Post not yet marked as solved
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?
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
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)
}
}
}
Post not yet marked as solved
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?
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