SettingGettable

public protocol SettingGettable

Protocol for types that can fetch a value from UserDefaults

  • Obtain the setting value under the given key.

    Declaration

    Swift

    static func get(key: String, userDefaults: UserDefaults) -> Self?

    Parameters

    key

    the setting name

    userDefaults

    the container to fetch from

    Return Value

    optional value