iOS Development--&QQ login interface for the utility of Swift article

Source: Internet
Author: User

QQ Login Interface Implementation

We know that in the App store almost all the software design to the account login, and our most common is QQ, in the absence of stepping into the programmer this no way, see the interface is feeling good tall on the look.

In the process of learning, they follow the mobile phone above the app's own more curious interface to achieve a bit, today to share about the QQ login interface, completely pure code, practical storyboar too troublesome, personal comparison like the implementation of code, and almost all the login interface is almost the same, but the icon is different, Or there will be other expansion functions, but there will be other natto is not a thing.

Nonsense not much to say directly on the code

Import UIKitclassViewcontroller:uiviewcontroller {///Defining Propertiesvar qqnumber =Uitextfield () var passnumber=Uitextfield ()Overridefunc viewdidload () {Self.view.backgroundColor=Uicolor.whitecolor () super.viewdidload ( )//Add a head picture[self. addallsubviews ()]; }     //Add all child controlsfunc addallsubviews () {///Avatar/var headimage = Uiimageview (Frame:cgrectmake ( -, -, -, $)) Headimage.image= UIImage (named:"Qq.png") Self.view.addSubview (headimage)///QQ number input hint       //var phonetext = UILabel (Frame:cgrectmake (+, Uiscreen.mainscreen (). bounds.size.width-60, +))//phonetext.text = "Please enter QQ number"//Self.view.addSubview (Phonetext)                ///QQ number Input Boxvar qqnumber = Uitextfield (Frame:cgrectmake ( -, the, Uiscreen.mainscreen (). bounds.size.width- -, -)) Qqnumber.placeholder="Please enter QQ number"QQNumber.layer.borderWidth=1QQNumber.layer.borderColor=Uicolor.lightgraycolor (). Cgcolor QQNumber.layer.cornerRadius=5Qqnumber.keyboardtype=uikeyboardtype.numberpad Self.view.addSubview (qqnumber) self. Qqnumber=Qqnumber///Password entry hint        //var passtext = UILabel (Frame:cgrectmake (+, Uiscreen.mainscreen (). bounds.size.width-60, ())//passtext.text = "Please enter password"//Self.view.addSubview (Passtext)                ///Password Entry boxvar passnumber = Uitextfield (Frame:cgrectmake ( -, the, Uiscreen.mainscreen (). bounds.size.width- -, -)) Passnumber.placeholder="Please enter your password"PassNumber.layer.borderWidth=1PassNumber.layer.borderColor=Uicolor.lightgraycolor (). Cgcolor PassNumber.layer.cornerRadius=5Self.view.addSubview (Passnumber) self. Passnumber=Passnumber///Password Recoveryvar button = UIButton (Frame:cgrectmake ( $, the, -, -) ) Uibutton.buttonwithtype (uibuttontype.custom) button.settitle ("Forgot Password", ForState:UIControlState.Normal) Button.settitlecolor (Uicolor.lightgraycolor (), ForState:UIControlState.Norm AL) Self.view.addSubview (button) Button.addtarget (Self, Action:"OnClick", ForControlEvents:UIControlEvents.TouchUpInside)} ///Password Retrieval method implementationfunc OnClick () {///Retrieve password hintUialertview (title:"Warm Tips", Message:"The new password has been sent to the phone",Delegate: Nil, Cancelbuttontitle:"Determine", Otherbuttontitles:"Cancel"). Show ()}/** Click the interface keyboard to resign the first responder*/    OverrideFunc Touchesbegan (Touches:nsset, witheventEvent: Uievent) {self. Qqnumber.resignfirstresponder () self. Passnumber.resignfirstresponder ()}}

iOS Development--&QQ login interface for the utility of Swift article

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.