Swift 基本控件UISlider学习


// @name create UISlider
let slider = UISlider(frame: CGRectMake(30, 200 + 130, 60, 30))
slider.addTarget(self, action: "clickSlider:", forControlEvents: .ValueChanged)
slider.minimumValue = 17.0
slider.maximumValue = 36.0
self.view.addSubview(slider)

func clickSlider(sender: UISlider!)
 {
        print("UISlider Value \(sender.value)");    
 }

打印结果:

UISlider Vaule: 0.075


你可能感兴趣的:(Swift 基本控件UISlider学习)