IOS imitation to get Verification code mode, xib+ automatic layout implementation

Source: Internet
Author: User

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
    1. Drag the entire folder Popcodeviewcontroller the project into your project.
    2. Import dependent library Pop animation library
    3. Custom controller, import Getcodeviewcontroller, Presentinganimator, Dismissinganimator class
    4. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.