Persistable

public protocol Persistable

Saves and retrieves (key, value) pairs to/from disk

  • Returns the object associated with the occurrence of the specified key.

    Parameter

    Parameter key: The key used to identify the object

    Returns

    The object associated with the specified key, or nil if the key was not found.

    Declaration

    Swift

    func object(forKey key: String) -> Any?

    Parameters

    key

    The key used to identify the object

    Return Value

    The object associated with the specified key, or nil if the key was not found.

  • Sets the value of the specified key to the specified object

    • Parameters:
      • object: The object to persist
      • defaultName: The key with which to associate with the object.

    Declaration

    Swift

    func set(_ object: Any?, forKey defaultName: String)

    Parameters

    object

    The object to persist

    defaultName

    The key with which to associate with the object.