AUTextCodeInputBox is a verification code input control.
API description
/**
The SMS verification code input box with a countdown timer.
*/
@interface AUTextCodeInputBox : AUSecurityCodeBox
/**
The wait time before an SMS message is sent.
*/
@property (nonatomic, assign) NSTimeInterval interval;
/**
* Create an SMS verification code input box.
* @param frame The position and size in the parent class.
* @param interval The wait time before an SMS message is sent.
* @return The input box for the text message verification code.
*/
- (AUTextCodeInputBox *)initWithFrame:(CGRect)frame interval:(NSTimeInterval)interval;
/**
* Create an SMS verification code input box.
* @param originY The Y-coordinate of the component.
* @param interval The wait time before an SMS message is sent.
* @return The input box for the text message verification code.
*/
- (AUTextCodeInputBox *)initWithOriginY:(CGFloat)originY interval:(NSTimeInterval)interval;
/**
* Set a block to be executed when countdown ends.
* @param block The block to be executed.
*/
- (void)setCountdownDidCompleteBlock:(void (^)(void))block;
Code sample
AUTextCodeInputBox *smsInputBox = [[AUTextCodeInputBox alloc] initWithOriginY:startY interval:60];
[smsInputBox.actionButton addTarget:self action:@selector(onSmsButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; // The callback for processing the event that the button on the right is tapped.
[self.view addSubview:smsInputBox];