NMAPinChange

@objc
public protocol NMAPinChange : NMAOperation

The object that can be used to change the PIN.

Usage example:

@interface NMAPinChangerImpl : NSObject<NMAPinChanger>

@end

@implementation NMAPinChangerImpl

- (void)changePinWithContext:(id<NMAPinChangeContext> _Nonnull)context handler:(id<NMAPinChangeHandler> _Nonnull)handler {
    [handler pinsWithOldPin:oldPin newPin:newPin];
}

@end

id<NMAPinChange> pinChangeOperation = [[client operations] pinChange];

[pinChangeOperation username:username];
[pinChangeOperation pinChanger:[[NMAPinChangerImpl alloc] init]];
[pinChangeOperation onSuccess:^{...}];
[pinChangeOperation onError:^(NMAPinChangeError * _Nonnull error) {...}];

[pinChangeOperation execute];
  • The username whose PIN must be changed.

    Important

    Providing the username is required.

    Declaration

    Swift

    @discardableResult
    func username(_ username: String) -> NMAPinChange

    Parameters

    username

    the username.

    Return Value

    the NMAPinChange builder.

  • Specifies the object that will be informed of the potential recoverable errors and is responsible for obtaining the PIN from the end-user.

    Important

    Providing the PIN changer is required.

    Declaration

    Swift

    @discardableResult
    func pinChanger(_ pinChanger: NMAPinChanger) -> NMAPinChange

    Parameters

    pinChanger

    Return Value

    the NMAPinChange builder.

  • Specifies the block to execute if the PIN was successfully modified.

    Important

    Providing the onSuccess block is required.

    Declaration

    Swift

    @discardableResult
    func onSuccess(_ onSuccess: @escaping () -> ()) -> NMAPinChange

    Parameters

    onSuccess

    the block to execute on successful PIN modification.

    Return Value

    the NMAPinChange builder.

  • Specifies the block to execute when the PIN could not be changed: - the PIN was not enrolled, - the PIN is locked - or the operation was canceled.

    Important

    Providing the onError block is required.

    Declaration

    Swift

    @discardableResult
    func onError(_ onError: @escaping (NMAPinChangeError) -> ()) -> NMAPinChange

    Parameters

    onError

    the block to execute on failed PIN modification, receives an NMAPinChangeError.

    Return Value

    the NMAPinChange builder.