Last active 3 years ago

  1. 3 years ago
    Sat 05 Dec 2015 10:08:58 PM CET
    plivez started the conversation UISlider to change TimeInterval.

    Hi, can you help a newbie please!

    I've created an animation from numerous images & a slider to generate values between 0.00 and 1.00 (both the animation and slider are working fine).

    I would like to use the slider values to change the interval time between each image, thereby varying the speed of the animation.

    But I can't figure out how to substitute the interval time (shown below currently as 0.01) with the slider value.

    Here is the relevant code:

        @IBOutlet var slider: UISlider!
        @IBAction func speedChanged(sender: AnyObject)
            timer = NSTimer.scheduledTimerWithTimeInterval(0.01, target: self, selector: Selector("doAnimation"), userInfo: nil, repeats: true)

  2. Sat 05 Dec 2015 09:48:19 PM CET
    plivez joined the forum.