JSDecodingStrategy

public enum JSDecodingStrategy<ReturnType>

The strategies to decode a value.

Strategies are used to determine whether the evaluation result sent by the web view is valid or not.

  • A return value is mandatory.

    If a value or an error is not provided, the result of the expression will be considered invalid.

    Declaration

    Swift

    case returnValueMandatory
  • The expression must not return a value.

    If a value is provided, the result of the expression will be considered invalid.

    When no value and no error is provided, the default value will be passed to your completion handler.

    This strategy must only be used when ReturnType is JSVoid, as the web view will not provide a value on success for this return type.

    Declaration

    Swift

    case noReturnValue(defaultValue: ReturnType)

    Parameters

    defaultValue

    The default value. Should be a JSVoid value, i.e. JSVoid().