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

Source: Internet
Author: User

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 UIKit class Viewcontroller:uiviewcontroller {///define attribute var Qqnumber = Uitextfield () var passnumber = Uitextfi Eld () override Func Viewdidload () {self.view.backgroundColor = Uicolor.whitecolor () supe    R.viewdidload ()//Add head picture [self. addallsubviews ()]; }//Add all child controls Func addallsubviews () {///avatar/var headimage = Uiimageview (Frame:cgrectmake (50, 30, ) Headimage.image = UIImage (named: "Qq.png") Self.view.addSubview (Headimage)///QQ No.  Input hint//var phonetext = UILabel (Frame:cgrectmake (+, Uiscreen.mainscreen (). bounds.size.width-60, 30))// Phonetext.text = "Please enter QQ number"//self.view.addsubview (phonetext)///QQ number input box var qqnumber = Uitext        Field (Frame:cgrectmake (), Uiscreen.mainscreen () bounds.size.width-60, ()) Qqnumber.placeholder = "Please enter QQ number" QQNumber.layer.borderWidth = 1 QQNumber.layer.borderColor = UIColor.lightgraycolor (). Cgcolor QQNumber.layer.cornerRadius = 5 Qqnumber.keyboardtype = Uikeyboardtype.numberpad Self.view.ad Dsubview (Qqnumber) self. Qqnumber = qqnumber//password input prompt//var Passtext = UILabel (Frame:cgrectmake (+, Uiscreen.mainscre En (). bounds.size.width-60, ())//passtext.text = "Please enter password"//self.view.addsubview (passtext)//        /Password input box var passnumber = Uitextfield (Frame:cgrectmake (+, Uiscreen.mainscreen (). bounds.size.width-60, 30)) Passnumber.placeholder = "Please enter password" PassNumber.layer.borderWidth = 1 PassNumber.layer.borderColor = Uicolo R.lightgraycolor (). Cgcolor PassNumber.layer.cornerRadius = 5 Self.view.addSubview (passnumber) self.        Passnumber = passnumber//password back var button = UIButton (Frame:cgrectmake (200, 360, 120, 30)) Uibutton.buttonwithtype (Uibuttontype.custom) button.settitle ("Forgot password", Forstate:uicontroLstate.normal) Button.settitlecolor (Uicolor.lightgraycolor (), ForState:UIControlState.Normal) Self.view.add           Subview (Button) Button.addtarget (Self, Action: "OnClick", ForControlEvents:UIControlEvents.TouchUpInside) }///Password retrieval method implementation Func OnClick () {///Retrieve password hint Uialertview (title: "Warm Prompt", message: "New password has been sent to the phone", Deleg Ate:nil, Cancelbuttontitle: "OK", Otherbuttontitles: "Cancel"). Show ()}/** Click interface keyboard resign First responder */override Func Tou Chesbegan (Touches:nsset, withevent event: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.