UpdatableProperty
public protocol UpdatableProperty : Property
-
Updates the value backing this
Property.Declaration
Swift
@discardableResult func updateValue(_ value: Value, date: Date) -> Snapshot<Value>Parameters
valueThe new value of the property.
dateThe date and time the
valuewas recorded. Defaults to the current date and time.Return Value
The new snapshot.
-
updateValue(_:Extension method)
-
updateValueIfDifferent(_:Extension methoddate: ) Updates the value backing this
Property, only if the provided value is different.Declaration
Swift
@discardableResult public func updateValueIfDifferent(_ value: Value, date: Date = Date()) -> Snapshot<Value>?Parameters
valueThe new value.
dateThe date and time the
valuewas recorded. Defaults to the current date and time.Return Value
The new snapshot, or
nilif the value was not different.
View on GitHub
UpdatableProperty Protocol Reference