OPPaymentCardCvvViewDelegate

@objc
public protocol OPPaymentCardCvvViewDelegate : NSObjectProtocol

Defines the interface that should be implemented to receive updates from instances of OPPaymentCardCvvView. Each callback method is optional so you only need to implement the ones you need.

Important

There are two versions of each callback method. One version contains a reference to the view and can be used if you are implementing these callbacks in your UI layer. If implementing callbacks in a data layer it is recommended to implement the versions that do not contain a reference to a view.
  • Called when the field changes due to user input. Useful if the delegate is being used in the UI layer.

    Declaration

    Swift

    @objc
    optional func fieldChanged(_ cvvView: OPPaymentCardCvvView)

    Parameters

    cvvView

    The view that changed

  • Called when the field changes due to user input. Useful if the delegate is not being used in the UI layer.

    Declaration

    Swift

    @objc
    optional func fieldChanged(with state: OPCardFieldStateProtocol)

    Parameters

    state

    The current state of the view that changed

  • Called when editing begins in the CVV view. Useful if the delegate is being used in the UI layer.

    Declaration

    Swift

    @objc
    optional func didBeginEditing(_ cvvView: OPPaymentCardCvvView)

    Parameters

    cvvView

    The view that is being edited

  • Called when editing begins in the CVV view. Useful if the delegate is not being used in the UI layer.

    Declaration

    Swift

    @objc
    optional func didBeginEditing(with state: OPCardFieldStateProtocol)

    Parameters

    state

    The current state of the view that is beign edited

  • Called when editing ends in the CVV view. Useful if the delegate is being used in the UI layer.

    Declaration

    Swift

    @objc
    optional func didEndEditing(_ cvvView: OPPaymentCardCvvView)

    Parameters

    cvvView

    The view that is no longer being edited

  • Called when editing ends in the CVV view. Useful if the delegate is not being used in the UI layer.

    Declaration

    Swift

    @objc
    optional func didEndEditing(with state: OPCardFieldStateProtocol)

    Parameters

    state

    The current state of the view no longer being edited

  • Called whenever the the CVV view’s isValid property changes. Useful if the delegate is being used in the UI layer

    Declaration

    Swift

    @objc
    optional func validStateChanged(_ cvvView: OPPaymentCardCvvView)

    Parameters

    cvvView

    The view that changed

  • Called whenever the the CVV view’s isValid property changes. Useful if the delegate is not being used in the UI layer.

    Declaration

    Swift

    @objc
    optional func validStateChanged(with state: OPCardFieldStateProtocol)

    Parameters

    state

    The current state of the view that changed