Skip to content

example cannot be used #36

@Lee0820

Description

@Lee0820

// Extend with a custom key
extension DefaultsKey {
static var someKey: Key { Key("someKey") }
}

// Then use it like this
defaults.set("Some key", for: .someKey)
defaults.get(for: .someKey) // Output: Some key

Xcode error:
Static stored properties not supported in protocol extensions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions