Post

Replies

Boosts

Views

Activity

How to fix the issue in the code shown at 21:40
At 21:40 in the video the following code is shown: (sorry for the screenshot but this talk doesn't have code copy enabled) Luca points out this results in new view and storage every time dayTime changes. Say you wanted to fix it so it doesn't create a new view and storage every time, how would you do that? Like this maybe? var body: some View { let cr = CatRecorder() if dayTime { return cr.nightTimeStyle() } else { return cr } } But this code doesn't look very declarative. I've seen many struggle with applying modifiers conditionally (especially .hidden()) so thought I'd ask.
1
0
1.5k
Jun ’21
When to purge the persistent history?
I enjoyed the video thanks. At 6mins when David said "You don't need to do anything else and your data will be indexed in Spotlight.". What immediately came to mind was what about cleaning up the persistent history? I had a brief look at the docs and noticed that indexDidUpdateNotification includes NSPersistentHistoryTokenKey should we listen for that and then purge the history? And what if we have multiple components requiring use of the persistent history? Is there a recommended strategy for deleting only the history not required by the Spotlight indexer and other components?
2
0
1.4k
Jun ’21
More info on restore state between split and tab hierarchies needed please
Please explain how and when the state should be transferred from split VC to tab controller when traits change from regular to compact. Please also consider then the middle “supplementary” column is in use. Please confirm we should no longer use adaptivity API given any showing alert or popover would likely be lost or should those also be in the state? Sample code of the relevant parts of the Shortcuts app would be very useful as this is a very difficult design pattern and it seems it is essential for cross platform apps targeting iPhone/iPad/Catalyst.
5
0
2.7k
Feb ’21