Ref

public class Ref<T>

A reference to an object that may change.

This is the base class used to access a backend object with an associated observer notified each time this associated object changes. Associated object may be nil if the corresponding backend object doesn’t exist yet or has been removed. Observer is notified when the backend object is created or removed, and when the ref is created if the backend object exists.

  • Reference observer.

    Declaration

    Swift

    public typealias Observer = (_ value: T?) -> Void

    Parameters

    value

    new referenced value

  • The associated backend object. May be nil.

    Declaration

    Swift

    public internal(set) var value: T? { get }