plivez

Member

Last active 2 years ago

  1. 2 years ago
    Sat Dec 5 22:08:58 2015
    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 Dec 5 21:48:19 2015
    plivez joined the forum.