Getcodeviewcontroller
To obtain the verification code, and verify the way. Many custom interfaces are available, highly customizable. You can also change the source code, the interface with xib files, plus automatic layout implementation, intuitive and understandable.
Run the project, first CD to the directory, the pod update, you can run, because the pop animation library. Usage
- Drag the entire folder Popcodeviewcontroller the project into your project.
- Import dependent library Pop animation library
- Custom controller, import Getcodeviewcontroller, Presentinganimator, Dismissinganimator class
- Custom controller, implement the following methods
#pragma mark-getcodeviewdelegate Method- (NSString*) Titleforcodeview {return[NSStringstringwithformat:@"The verification code has been sent to your phone 187*****1234"];} - (NSString*) Titleforcodebutton {return@"Get Verification Code";} - (Nsinteger) Timecode {return -;}/** * Can be in this method to do some network request operation, such as Click to re-obtain the verification code, * Successful call [CODEVC Starttimer], start the countdown, a new round of verification code verification. */- (void) Getcodebutton: (Getcodeviewcontroller *) CODEVC {[Codevc starttimer];} - (BOOL) Isstart {return NO;} - (void) CancelButton: (Getcodeviewcontroller *) CODEVC {[Codevc dismissviewcontrolleranimated:YESCompletion:Nil];} - (void) Surebutton: (Getcodeviewcontroller *) CODEVC {NSLog(@"OK");}#pragma mark-uiviewcontrollertransitioningdelegate- (ID<UIViewControllerAnimatedTransitioning>) Animationcontrollerforpresentedcontroller: (Uiviewcontroller*) presented Presentingcontroller: (Uiviewcontroller*) Presenting Sourcecontroller: (Uiviewcontroller*) source{return[Presentinganimator new];} - (ID<UIViewControllerAnimatedTransitioning>) Animationcontrollerfordismissedcontroller: (Uiviewcontroller*) dismissed{return[Dismissinganimator new];}
5. Call to implement the following code
new]; self; self; getCodeViewController.modalPresentationStyle = UIModalPresentationCustom; [self presentViewController:getCodeViewController animated:YES completion:NULL];
Version
Support iOS7.0 and above.
GitHub Address: Https://github.com/804145113/GetCodeViewController
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
IOS imitation to get Verification code mode, xib+ automatic layout implementation