ReceiptState

public enum ReceiptState

This enum controls the state of the receipt button that is associated with the progress callback in one of the delegate methods from YocoReceiptDelegate.

  • The default state of the button, ready for user input in the textfield or button presses.

    Declaration

    Swift

    case initial
  • When the user has pressed the send receipt button, if any asynchronous work needs to be done before the receipt can be sent, then the button should be put into this state. Optionally you can add a message to the progress that will override the textfields text.

    Declaration

    Swift

    case inProgress(message: String? = nil)

    Parameters

    message

    A string message you want to show in place of the textfields text while progress is happening.

  • If the users input fails validation or you need to show some kind of error message, use this state to show the error message.

    Declaration

    Swift

    case error(message: String)

    Parameters

    message

    A string message of the error that has occurred.

  • When the user has pressed the send receipt button and the receipt has successfully been processed, you can use this state to put the button into a completed state. Optionally you can add a message to the completed state that will override the textfields text.

    Declaration

    Swift

    case complete(message: String? = nil)

    Parameters

    message

    A string message you want to show in place of the textfields text when the operation succeeds.