Slider determines gravity
<p>So far I've created a rectangle that starts from the bottom and moves upward using UiDynamicAnimator. I would like the user to determine the "strength" of the negative gravity. I want the user to determine the value through a slider. </p>

<p>This is my code so far:</p>

<pre><code>    import UIKit

class ViewController: UIViewController {

    var orangeSquare: UIView?
    var animator: UIDynamicAnimator?

    override func viewDidLoad() {
        super.viewDidLoad()


        func sliderChanged(sender: AnyObject) {

            var sliderValue = sender.value

        }

                //Create animation
            let dim = CGRectMake(100, 500, 200, 100)
            orangeSquare = UIView(frame: dim)
            orangeSquare?.backgroundColor = UIColor.orangeColor()

                //Add item to the screen
            self.view.addSubview(orangeSquare!)

                //Initialize the animator
            animator = UIDynamicAnimator(referenceView: self.view)

                //Add gravity
            let gravity = UIGravityBehavior(items: [orangeSquare!])
            let direction = CGVectorMake(0.0, sliderValue)
            gravity.gravityDirection = direction

                //Collision
            let boundries = UICollisionBehavior(items: [orangeSquare!])
            boundries.translatesReferenceBoundsIntoBoundary = true

                //Add animations
            animator?.addBehavior(boundries)
            animator?.addBehavior(gravity)

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}
</code></pre>

<p>I get two errors:</p>

<p>"Ambiguous use of ´value´" and
"Use of unresolved identifier ´sliderValue´"</p>

<p>How do I convert ´sliderValue´ into a float with just one decimal point?</p>