Posts

Post marked as Apple Recommended
184 Views
How can I open the user's Health Privacy Settings directly from my app when I'd like them to review them? I believe similar questions have been asked before like this one: https://forums.developer.apple.com/forums/thread/730434 However, I'm wondering if the situation is changed for iOS 17 or if there's a way that works for Health permissions. This is directly possible in the Garmin Connect app for example which is a major app on the store.
Posted Last updated
.
Post marked as solved
10 Replies
1.5k Views
I'm looking to migrate my users ClockKit complications to WidgetKit in my next app update. I can only do this for WatchOS 10 users because the APIs are too limited for WatchOS 9 (eg. Widget corner round text not available). But I do need to do this for WatchOS 10 users in order to get in the Smart Stack. When I tried to mark my getWidgetConfiguration method in my ComplicationController.swift with: @available(watchOS 10.0, *) it complains and says: Protocol 'CLKComplicationWidgetMigrator' requires 'getWidgetConfiguration(from:completionHandler:)' to be available in watchOS 9.0 and newer I then tried modifying my WidgetKit extension to only support WatchOS 10. This seems to work for a while but at some point WatchOS 9 devices still try the migration and crash with symbolNotFound DYLD issues for the WidgetKit extension which shouldn't even be embedded in the WatchOS 9 builds! (all visible in iPhone Analytics data crashes) So I'm not sure what else to try. I've researched a lot in docs etc... but can find no official way to achieve this.
Posted Last updated
.
Post not yet marked as solved
0 Replies
507 Views
I'm seeing problems with the new Apple Watch Modular Ultra Watch face... This is all using the latest WatchOS 10.1 and with WidgetKit complications. (Have also tested with the new WatchOS 10.2 beta in the simulator) The Graphic Circular (accessoryCircular) complications space the numbers differently sometimes causing maximum and minimum numbers to look like one long number (see small circular complications in screenshot) The exact same complication in the accessoryRectangular on the Modular Ultra face clips text when it doesn't on any other watch face I've filed feedback FB13344580 Hopefully the screenshots show the issue well.
Posted Last updated
.
Post marked as solved
2 Replies
956 Views
My app's Widgets on iPhone rely on access to the Health Store to update. This makes them appearing in the new StandBy mode not a good experience as they never update. Is there a way to opt out of this mode but keep the options for my users to put Widgets on their home screen? Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
493 Views
I'm having a problem in my app where when the use dismisses the side bar in a NavigationSplitView, the TabView on the detail view animates with a glitch to an offset page position. I've simplified the issue into a Single View which can be previewed in Xcode. This issue occurs on real hardware and in the simulator. This issue only occurs in landscape on iPad when dismissing the sidebar. Here is the code: struct ContentView: View { @State var pageIndex = 9 var body: some View { NavigationSplitView { Text("AppSidebarList") } detail: { TabView(selection:$pageIndex) { ForEach(0..<10, id:\.self) { i in ScrollView(.vertical, showsIndicators: false) { Text("Page \(i)").padding(.top,50) Rectangle().fill(Color.red) .frame(height:25).frame(maxWidth:.infinity) .padding() } } }.tabViewStyle(.page(indexDisplayMode: .never)) }.accentColor(Color.indigo) } } Here is the preview before selecting anything: This is then the expected behaviour after selecting the button top left to hide the sidebar: But instead the transition animation glitches and I get this: Note, the page is offset as indicated by the red bar. I've tried playing around with frame of maxWidth:.infinity. This issue does not happen if the iPad is in portrait, this seems to be because the sidebar in this mode overlays the detail view, where as in portrait they share the space and the detail view resizes to fill the space. Note the page index, it's the app behaviour that the TabView shows a selection of pages with the last one being the default and the user swiping backwards through. This issue does not occur if the default pageIndex is 0 Either this is a bug or there's a work around or I'm not using something correctly. It would be good to establish which. Many thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
744 Views
Anyone who has successfully migrated to using WidgetKit for their Apple Watch complications, your help would be greatly appreciated! I've migrated to WidgetKit for my Watch app. On the Apple Watch Face Editor, the new Widget names and options appear correctly. However, on the iPhone Apple Watch app, it offers both WidgetKit and old ClockKit complications... this should not be. I also have found rendering issues where Watch Faces on the main My Watch tab have blank gaps for WidgetKit complications, when selecting the Watch Face they then render (see photos) I've put in a feedback FB12460375 Have tried a full clear and reinstall of my app on both devices, no change. This issue occurs on WatchOS 9.5.2 / iOS 16.5.1 and WatchOS 10 Beta 2 / iOS 17 Beta 2 Any other ideas?
Posted Last updated
.
Post not yet marked as solved
0 Replies
500 Views
Relative Date labels on WatchOS complications do not update when in the .WidgetLabel section modifier. Am I missing anything? For example if I want a .accessoryCircular complication in the top centre middle of the Infograph Watch Face, I can have maybe an Icon for the app in the circular slot and then use the .WidgetLabel modifier to display text. However, the Text(Date(), style: .relative) will not update in the WidgetLabel area, but it will update in main area. This is a bug I suspect. This same problem also exists with the .accessory corner complications and the WidgetLabel. The best example of where this works fine currently in the WatchOS system is the Heart Rate complication. Here the WidgetLabel text shows the relative date. It also has formatting options for the date (like only showing minutes), none of this is available to third party developers. Have tested this on the latest public releases of iOS, WatchOS & Xcode as well as the new iOS 17, WatchOS 10 and Xcode 15 Beta releases. Example Code: import SwiftUI import WidgetKit struct WatchWidget: Widget { let kind: String = "WatchWidget" var body: some WidgetConfiguration { StaticConfiguration(kind: kind, provider: TimelineProvider()) { entry in Text(Date(), style: .relative) .widgetLabel { Text(Date(), style: .relative) } } .configurationDisplayName("WatchWidget") .description("WatchWidget") .supportedFamilies([.accessoryCircular, .accessoryCorner]) } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
683 Views
I'm trying to ensure my watch app launches as quickly as possible. I'm using the @WKApplicationDelegateAdaptor because of needing to implement the BackgroundRefresh handlers. What I'm finding is that the time between the app calling the main init() and then the ExtensionDelegate calling applicationDidFinishLaunching is often > 2 seconds. I've tried using Instruments to profile the App launch but have never had any luck with the tool on a watch app. So I then created a blank project just with the elements needed to implement the same WKApplicationDelegateAdaptor and oslog calls, performance was the same... This is tested on WatchOS 9.5 & 9.5. This is on a Series 6 and Series 8 Apple Watch (FYI S6 == S7 == S8 for Apple Watch CPU performance) Interestingly, on the simulator, the time gap was less, more like 1 second between main init() and applicationDidFinishLaunching.... not sure why this would be this way. Anyway, for real world device usage, is this the best performance I can expect? Is there anything that can be done to improve this?
Posted Last updated
.
Post marked as solved
2 Replies
851 Views
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
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.2k Views
On my Watch app pre-WatchOS 9 I had code as follows: ` TabView { NavigationView { TodayView(model: delegate.model) .navigationBarTitleDisplayMode(.large) } NavigationView { SettingsView(model: delegate.model) } } .tabViewStyle(.page) However, for WatchOS 9 I'm using the new NavigationStack like this: ` NavigationStack { TabView { TodayView(model: delegate.model) .navigationBarTitleDisplayMode(.large) The issue is, with WatchOS 9 the title always displays as .inline and never large. I've tried embedding a list or scroll view. I've also tried placing a navigationView within the NavigationStack and TabView, that just makes duplicate titles. So, using the NavigationStack with a TabView on WatchOS 9, how do you get large titles? Thanks
Posted Last updated
.
Post marked as solved
1 Replies
1.9k Views
I'm trying to create a UI layout and navigation functionality similar to the Apple Fitness app on Apple Watch. This is all WatchOS 9 so no need for older API support, phew! I want to have NavigationTitle set for each view in a TabBar. I want each selected NavigationDestination to hide the TabBar controls and disable swiping when opened. I want the NavigationTitle and update to remain whilst navigating between Tabs and Childs. I've created this sample code based off the Building a productivity app for Apple Watch sample code from Apple and other examples on navigation with the new NavigationStack in WatchOS 9, iOS 16 etc... import SwiftUI @main struct Test_Watch_App_Watch_AppApp: App {     @SceneBuilder var body: some Scene {         WindowGroup {             TabView {                 NavigationStack {                     ScrollView {                         VStack {                             NavigationLink("Mint", value: Color.mint)                             NavigationLink("Pink", value: Color.pink)                             NavigationLink("Teal", value: Color.teal)                         }                     }                     .navigationDestination(for: Color.self) { color in                         Text("Hello").background(color)                     }                     .navigationTitle("Colors")                 }                 NavigationStack {                     ScrollView {                         VStack {                             NavigationLink("headline", value: Font.headline)                             NavigationLink("title", value: Font.title)                             NavigationLink("caption", value: Font.caption)                         }                     }                     .navigationDestination(for: Font.self) { font in                         Text("Hello").font(font)                     }                     .navigationTitle("Fonts")                 }             }.tabViewStyle(.page)         }     } } The problem here is, when selecting any of the Navigation Links, the child view still displays the Tab Bar page indicators and allows you to swipe between the tabs, I don't want this. The functionality as I'd like exists int eh Apple Fitness app on the Watch. The app launches in the Activity Tab. You can swipe across to Sharing, select a person, and in that view it's not then possible to swipe straight back to Activity. I've tried Embedding the whole TabView in a NavigationStack and removing the NavigationStacks per tab. This works as far as fixing the child views hiding the TabBar page indicator controls and swiping. However, it then breaks NavigationTitles on launch and when moving in and out of Childs, so I don't think it should be this way. Any help very appreciated.
Posted Last updated
.
Post not yet marked as solved
0 Replies
1.2k Views
I supported the Always-On display in my app complications from day one but since am continuing to find animation glitches and bugs that have never been fixed and exist currently on WatchOS 8 & 9 (I've tried Series 6 & 8 devices). I'm thinking about scrapping it and just returning the handler(nil). Does anyone have an example of where they use it and it really adds value to their app complications? And do they have any suggestions to try and work around the glitches? Thanks
Posted Last updated
.
Post marked as solved
2 Replies
2k Views
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
Posted Last updated
.
Post not yet marked as solved
4 Replies
2.3k Views
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.
Posted Last updated
.
Post marked as solved
4 Replies
3.1k Views
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?
Posted Last updated
.