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 pins:oldPin :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 take care of changing the PIN of the specified username.
Important
Providing the PIN changer is required.Declaration
Swift
@discardableResult func pinChanger(_ pinChanger: NMAPinChanger) -> NMAPinChange
Parameters
pinChanger
the
NMAPinChanger
Return Value
the
NMAPinChange
builder. -
Specifies the block to execute if the PIN was successfully modified.
Important
Providing theonSuccess
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 theonError
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.