SDKInstanceProperty

extension MoEngageStorage.SDKInstanceProperty: MoEngageStorage.ReadOnlyLocation
extension MoEngageStorage.SDKInstanceProperty: MoEngageStorage.WriteOnlyLocation
extension MoEngageStorage.SDKInstanceProperty: MoEngageStorage.MigratableLocation
where Value: MoEngageStorage.ResettableValue
  • Reads the value from the given SDK instance using the stored getter closure.

    Declaration

    Swift

    public func read(
        withInput input: Void,
        fromInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) throws(ReadError) -> Value

    Parameters

    input

    Unused (Void).

    sdkInstance

    The isolated SDK instance whose property is read.

    Return Value

    The current value produced by the getter.

WriteOnlyLocation

  • Writes a value to the SDK instance using the stored setter closure.

    If no setter was provided at initialisation this is a no-op.

    Declaration

    Swift

    public func write(
        _ value: Value,
        toInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) throws(WriteError)

    Parameters

    value

    The value to assign.

    sdkInstance

    The isolated SDK instance whose property is updated.

Available where Value: MoEngageStorage.ResettableValue

  • Resets the property to MoEngageStorage/ResettableValue/resetValue by calling write.

    If no setter was provided at initialisation this is a no-op.

    Declaration

    Swift

    public func remove(
        fromInstance sdkInstance: isolated MoEngageSDKInstance = #isolation
    ) throws(WriteError)

    Parameters

    sdkInstance

    The isolated SDK instance whose property is reset.