MNAtomicDictionary

open class MNAtomicDictionary<Key, Value> where Key : Hashable, Value : Hashable

Encapsulates a dispatch semaphore with a dictionary of hashable keys and values

  • Inserts or updates the value stored in the dictionary for the given key

    Declaration

    Swift

    public func insertOrUpdate(key: Key, value: Value)

    Parameters

    key

    The key by which a value is stored

    value

    The value associated with the provided key

  • Declaration

    Swift

    public func getValue(forKey: Key) -> Value?

    Return Value

    the value associated with a given key

  • Removes the value associated with the specified key

    Declaration

    Swift

    public func removeValue(forKey: Key)

    Parameters

    key

    The key whose associated value will be deleted.

  • Declaration

    Swift

    public func getKeys() -> [Key]

    Return Value

    An array of all the keys in the atomic dictionary