Hello, Awhile ago I'd refactored my code to have @SceneStorage
in a ViewModifier
and not on a View
. In Xcode 15.3, I see a runtime-only warning:
SceneStorage is only for use with SwiftUI App Lifecycle. This will become a fatal error in a future release.
Accessing a SceneStorage value outside of being installed on a View. This will always return the default value.
Creating a Binding to SceneStorage value outside of being installed on a View. This will result in a constant Binding of the default value and will not update.
I'd used a ViewModifier
to encapsulate this code. Why is that different than a View
?
If you are interested you can see an example here: https://github.com/bolsinga/site/blob/ffbedd7fb134675496f529cf62484ceb9b79d360/Sources/Site/Music/UI/ArchiveStorageModifier.swift#L15
Thanks for any tips!