WTF. How is UUID not one of the types you can store in @SceneStorage? And worse, how come the limited types usable aren't documented*? #Swift #SwiftUI

*I've searched the pages for SceneStorage, AppStorage, and “Restoring your app's state with SwiftUI" and haven't found mention of data type restrictions.

I scrutinized the “Restoring your app's state with SwiftUI" page and found this one sentence buried innocuously in a dense paragraph: “The value is required to be of a plist type, so the system can save and restore it correctly.”

https://developer.apple.com/documentation/swiftui/restoring-your-app-s-state-with-swiftui

Nowhere does it list what “plist type” contains, nor does it link to a definition. After manually searching for plist types I found the “Information Property List" page on Apple's documentation site, which also does not provide any useful information about supported data types.

https://developer.apple.com/documentation/bundleresources/information-property-list

#Swift #SwiftUI

Restoring your app’s state with SwiftUI | Apple Developer Documentation

Provide app continuity for users by preserving their current activities.

Apple Developer Documentation

@gregatron5 an approximation of them is listed on the UserDefaults page:

"The defaults database supports the same value types found in property list files, including types like Int, Float, Double, Bool, String, URL, NSNumber, Date, Array, and Dictionary. To include other types of objects in the defaults database, archive them to a Data object first and store that object instead.”

https://developer.apple.com/documentation/foundation/userdefaults

UserDefaults | Apple Developer Documentation

An interface to the user’s defaults database, which stores system-wide and app-specific settings.

Apple Developer Documentation
@amyworrall ”man plist” in Terminal or developer.apple.com/library/a… gives you a list of CF types that map quite readily to Swift types
Introduction to Property List Programming Topics for Core Foundation

Explains how to use structured, textual representations of data in Core Foundation.