ipad Development--qq Space Layout, login module

Source: Internet
Author: User

I. Login module

  • Login logic
    1-(Ibaction) Loginclick: (UIButton *) Sender {2     3self.view.userInteractionEnabled =NO;4     5 [Self.view Endediting:yes];6     7 [Self.activeview startanimating];8     9     if(Self.accountField.text.length = =0|| Self.pwdField.text.length = =0) {Ten          One[Self ShowError:@"account number and password cannot be empty"]; A     } -     if([Self.accountField.text isequaltostring:@"123"] && [Self.pwdField.text isequaltostring:@"123"]) { -          the         //account password correct jump controller -Chaosmainviewcontroller *MAINVC =[[Chaosmainviewcontroller alloc] init]; -MainVC.view.backgroundColor = [Uicolor colorwithred: -/255.0Green -/255.0Blue -/255.0Alpha1.0]; - [self PRESENTVIEWCONTROLLER:MAINVC animated:yes completion:nil]; +          -}Else { +          A[Self ShowError:@"incorrect account or password"]; at     } -      -}

  • Animation effect after unsuccessful sign-in
    1- (void) ShowError: (NSString *) Error2 {3Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (1.0* nsec_per_sec)), Dispatch_get_main_queue (), ^{4         5Uialertcontroller *alert = [Uialertcontroller alertcontrollerwithtitle:@"Login Error"Message:error Preferredstyle:uialertcontrollerstylealert];6[Alert addaction:[uialertaction Actionwithtitle:@"Determine"Style:uialertactionstyledefault handler:^ (Uialertaction *_nonnull Action) {7             8         }]];9         Ten [self Presentviewcontroller:alert animated:yes completion:nil]; One          ACakeyframeanimation *shakeanim = [cakeyframeanimation animationwithkeypath:@"transform.translation.x"]; -Shakeanim.values = @[@-Ten,@0,@Ten,@0]; -Shakeanim.repeatcount =9; theShakeanim.repeatduration =0.3; -         //Animation - [Self.animView.layer Addanimation:shakeanim forkey:nil]; -          + [Self.activeview stopanimating]; -          +self.view.userInteractionEnabled =YES; A     }); at      -}

  • Remembering passwords and Automatic login logic

ipad Development--qq Space Layout, login module

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.