I hereby claim:
- I am pdarcey on github.
- I am pdarcey (https://keybase.io/pdarcey) on keybase.
- I have a public key whose fingerprint is 885D 9035 9A21 FFF6 03B0 E165 C55C B57F 51F8 9ABE
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// MARK: - Use Enums for getting/setting User Defaults | |
protocol KeyNameSpaceable { | |
func namespaced<T: RawRepresentable> (_ key: T) -> String | |
} | |
extension KeyNameSpaceable { | |
func namespaced<T: RawRepresentable> (_ key: T) -> String { | |
return "\(Self.self).\(key.rawValue)" |
// See comments below |
Usually, you set your grid up with something to generate your [GridItems]
, often something like:
var items: [GridItem] {
return Array(repeating: .init(.adaptive(minimum: 250), spacing: 10, alignment: .center), count: 1)
}
See that 1
at the end? That's the important bit!
(Technically, it can be other numbers too and still work, but 1 is kinda what the Grid will be looking for, and what you expect the result to look like, when it adaptive.
Where does SwiftData store things on the Mac?
On iOS, this directory is in the app's own storage location (app_UUID/Library/Application Support) but, on the Mac, it's a shared location in the user's Library.
By default on the Mac, SwiftData stores its model in the /~/Library/Application Support directory as default.store
. (It will also add two other files, default.store-shm
and default.store-wal
, as the model is stored as a SQLite database, and these are these additional files are part of how SQLite works.)