iOS Development--ui Article Swift &uiswitch/uistepper

Source: Internet
Author: User

Uiswitch/uistepper

1     Overridefunc viewdidload () {2 super.viewdidload ()3         4Titlelabel.text =titlestring5         6         7         //Do any additional setup after loading the view.8         9         //To create a switch controlTenvar switchview:uiswitch = Uiswitch (Frame:cgrectmake ( -, -, -, +)) One          A         //Add to view - Self.view.addSubview (SwitchView) -          the         //set to open -Switchview.on =true -          -         //or +Switchview.seton (true, Animated:true) -          +         //Add uicontrolevents.valuechanged event to detect switch switching ASwitchview.addtarget (Self, Action:"Switchchange:", forControlEvents:UIControlEvents.ValueChanged) at          -          -          -          -         //-------------------------- -          in         //Creating progressive controls -var stepperview:uistepper = Uistepper (Frame:cgrectmake ( $, -, the, +)) to          +         //Add to view - Self.view.addSubview (Stepperview) the          *         //set minimum value, default is 0.0 $Stepperview.minimumvalue = -Panax Notoginseng          -         //set maximum value, default is 100.0 theStepperview.maximumvalue = - +          A         //set current value, default is 0.0 theStepperview.value = - +          -         //sets the increment or decrement value, which is 1.0 by default $Stepperview.stepvalue = - $     } -  -     Overridefunc didreceivememorywarning () { the super.didreceivememorywarning () -         //Dispose of any resources the can be recreated.Wuyi     } the      -  Wu     /* - //MARK:-Navigation About  $ //In a storyboard-based application, you'll often want to do a little preparation before navigation - override func Prepareforsegue (segue:uistoryboardsegue!, sender:anyobject!) { - //Get The new view controller using Segue.destinationviewcontroller. - //Pass The selected object to the new view controller. A     } +     */ the  -      $     //switching events for the detection switch theFunc Switchchange (sender:anyobject?) the     { the //var newswitch:uiswitch = sender as Uiswitch the          -         //Modified May 2, 2015 invar Newswitch:uiswitch = Sender as!Uiswitch the          the println (Newswitch.on) About}

iOS Development--ui Article Swift &uiswitch/uistepper

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.