Post

Replies

Boosts

Views

Activity

Navigating in and out of a NavigationSplitView
The new NavigationSplitView is very handy. I want to use it for a settings screen, but I need a way to navigate in and out of it. Previously I just navigated in and out of my settings using a NavigationView. But if I change this to a NavigationStack, and then navigate forward into a NavigationSplitView from it, it almost works fine, but some weirdness happens: on iPhone there are two competing back arrows (i.e "<") and on an iPad there is weird spacing at the top of the screen. Should I be able to navigate from a NavigationStack into a NavigationSplit View? If so, are these known issues? If not, is there a recommended UI for navigating in and out of a NavigationSplitView from the rest of my iPhone/iPad app? thanks!
3
1
1.5k
Jun ’22
How to dynamically configure watch widget using phone app?
I'm excited to already have a widget/complication running on watchOS using WidgetKit. It's a great framework! Next, I need to get some settings from my iOS app over to the watch to help configure the widget. Ideally, I'd like the user to be able to change settings on the iOS app, and have them reflected in the watch widget pretty soon after without having to do anything on the watch. (From early testing, updateApplicationContext is decent because it can still be sent even when the watch app isn't active, but unfortunately it doesn't seem to wake up to process this incoming data until the user manually opens the app on the watch again. But maybe I've missed something.) Anyway, what's the best way to do this configuration between phone and watch?
0
1
694
Jun ’22
How to handle complication update with urlSession
At https://developer.apple.com/documentation/clockkit/updating_your_complication there is this information: Also, there’s no guarantee about the order in which the system calls URLSession:downloadTask:didFinishDownloadingToURL: and handleBackgroundTasks:. Your app must handle all possible cases. In example code I've seen online, people usually receive a call to handleBackgroundTasks with a WKURLSessionRefreshBackgroundTask, store that value, then receive a didFinishDownloadingToURL, process the download, and then call setTaskCompletedWithSnapshot with the stored value. If didFinishDownloadingToURL occurs first, and then the handleBackgroundTasks with a WKURLSessionRefreshBackgroundTask occurs second, then we presumably need to call setTaskCompletedWithSnapshot immediately. How do we know that's the right thing to do? Are we supposed to observe timing to understand that these two seperate calls are related? Are we supposed to maintain our own state machine to know that we are about to receive a pair of calls in unknown order? What's the right way to structure our behavior here? thanks
1
0
801
Jun ’20