iCloud
- data you want to appears on all the users devicesCloudKit
- famework for making this happens
- For structs that contain only other codeables, Swift will implement the Codable for you.
- For enums Swift will implement Codable for you unless you have associated data
- Things can only be stored in a
Property List
- This is just an idea or concept.
- Any combination of these things but it has to be a combination of only these things
- The loop whole is that
Data
is one of these types so we can take aCodable
and store it asData
if we which.
The UserDefaults API has a type in it called Any
. And Any is anti Swift. It means untyped. And Swift being a typed language doen't like. So we just adjust.
array(forKey)
returns an Any
. But you need to figure out how to convert. So we convert into an array of something we know using as ?
.
Can avoid a lot of this if you use Codable
.