BasicProperty
@propertyWrapper
open class BasicProperty<Value, Formatter> : UpdatableProperty where Formatter : Formatter
extension BasicProperty: Equatable where Value: Equatable
-
Declaration
Swift
public var wrappedValue: Value { get set } -
Declaration
Swift
public var projectedValue: ReadOnlyProperty<BasicProperty<Value, Formatter>> { get } -
Declaration
Swift
public var asReadOnlyProperty: ReadOnlyProperty<BasicProperty<Value, Formatter>> { get }
-
A human-friendly display name that describes the property.
Declaration
Swift
public let displayName: String -
The latest snapshot of data.
Declaration
Swift
@Published public internal(set) var snapshot: Snapshot<Value> { get set } -
The current value of the property.
Declaration
Swift
public internal(set) var value: Value { get set } -
A formatter that can be used to build a human-friendly string from the value.
Declaration
Swift
public let formatter: Formatter -
Declaration
Swift
public var snapshotsPublisher: AnyPublisher<Snapshot<Value>, Never> { get }
-
Declaration
Swift
public required init( displayName: String, value: Value, formatter: Formatter = Formatter(), date: Date = Date() )
-
Updates the value backing this
Property.Declaration
Swift
@discardableResult public 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.
-
Declaration
Swift
public static func == ( lhs: BasicProperty<Value, Formatter>, rhs: BasicProperty<Value, Formatter> ) -> Bool
-
Declaration
Swift
public convenience init( displayName: String, optionalValue: Value = nil, formatter: Formatter = Formatter(), date: Date = Date() )
View on GitHub
BasicProperty Class Reference