CustomProperties
public struct CustomProperties : Equatable
A container class for key-value custom properties
-
Creates a new
CustomPropertiesinstance.Declaration
Swift
public init() -
Removes the given key and its associated value.
Declaration
Swift
@discardableResult public mutating func removeValue(forKey key: String) -> AnyHashable?Parameters
keyThe key to remove along with its associated value.
Return Value
The value that was removed, or nil if the key was not present.
-
Adds a Bool property.
Declaration
Swift
public mutating func addBool(key: String, value: Bool)Parameters
keyThe key of the property.
valueThe value of the property.
-
Adds an Int property.
Declaration
Swift
public mutating func addInt(key: String, value: Int)Parameters
keyThe key of the property.
valueThe value of the property.
-
Adds a Float property.
Declaration
Swift
@available(*, deprecated, message: "Use addDouble(key:value:﹚ instead. Float values added will be converted to Double.") public mutating func addFloat(key: String, value: Float)Parameters
keyThe key of the property.
valueThe value of the property.
-
Adds a Double property.
Declaration
Swift
public mutating func addDouble(key: String, value: Double)Parameters
keyThe key of the property.
valueThe value of the property.
-
Adds a String property.
Declaration
Swift
public mutating func addString(key: String, value: String)Parameters
keyThe key of the property.
valueThe value of the property.
-
Adds an Array of Strings property.
Declaration
Swift
public mutating func addArray(key: String, value: [String])Parameters
keyThe key of the property.
valueThe value of the property.
-
Returns all keys and its associated values.
Declaration
Swift
public func getAll() -> [String : AnyHashable]Return Value
A dictionary with all the keys and its associated values