Skip to content

User Defaults

To print the path where the plist file is stored in the iOS simulator.

let library_path = NSSearchPathForDirectoriesInDomains(.libraryDirectory, .userDomainMask, true)[0]

print("library path is \(library_path)")

Persisting data

SO

Swift guide

Custom dictionary

Specify which part of data would be under a certain class name / struct.

NSHomeDirectory()

https://crystalminds.medium.com/where-are-the-standard-userdefaults-stored-d02bf74854ff

Note about User Defaults drawbacks. https://www.hackingwithswift.com/guide/ios-swiftui/4/2/key-points