简体   繁体   中英

NSSLider Set Starting Value

I'm trying to get my NSSlider to start at a certain value, and I've been unable to find function to do that in the swift book or other resources. Is there an easy way to do this?

Thanks

You have to first create an outlet for your NSSlider:

@IBOutlet weak var yourSlider: NSSlider!

then you just have to set it's initial value as follow:

yourSlider.doubleValue = 0.5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM