Property

public class Property<TypeSpec> where TypeSpec : PropertyTypeSpec

A property on a Swindler object.

Property values are watched and cached in the background, so they are always available to read.

Throws

Only PropertyError errors are given for rejected promises.
  • Undocumented

    Declaration

    Swift

    public typealias PropertyType = TypeSpec.PropertyType
  • Undocumented

    Declaration

    Swift

    public typealias NonOptionalType = TypeSpec.NonOptionalType
  • Undocumented

    Declaration

    Swift

    public typealias OptionalType = TypeSpec.NonOptionalType?
  • The value of the property.

    Declaration

    Swift

    public var value: PropertyType { get }
  • Forces the value of the property to refresh.

    You almost never need to call this yourself, because properties are watched and updated automatically.

    You might need this if, for example, you receive information via a side channel that a property has updated, and want to make sure you have the latest value before continuing.

    Throws

    PropertyError (via Promise)

    Declaration

    Swift

    @discardableResult
    public func refresh() -> Promise<PropertyType>