func testUISlider(){let slider = UISlider(frame: CGRectMake(0, 70, 300,40))slider.center = self.view.centerslider.minimumValue = 0slider.maximumValue = 1slider.value = 0.5slider.continuous=false //滑块滑动停止后才触发ValueChanged事件slider.addTarget(self, action: "valuechage:", forControlEvents: UIControlEvents.ValueChanged)self.view.addSubview(slider)}func valuechage(sender: UISlider){print(sender.value)}