title: Programmatically Change UILabel with UISlider in Swift
body: <p>I'm learning Swift and trying to programmatically change a Label value with a Slider. I get an error in the func says paybackLabel is an unresolved identifier. How should this be done?</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          //Create Label
          let paybackLabel = UILabel(frame: CGRectMake(0, 0, 300, 41))
          paybackLabel.center = CGPointMake(190, 284)
          paybackLabel.textAlignment = NSTextAlignment.Center
          paybackLabel.font = UIFont(name: paybackLabel.font.fontName, size: 40)
          paybackLabel.textColor = UIColor.whiteColor()
          paybackLabel.text = "Hello World"
          self.view.addSubview(paybackLabel)
  
          //Create Slider
          let paybackSlider = UISlider(frame: CGRectMake (45,546,310,31))
          paybackSlider.minimumValue = 0
          paybackSlider.maximumValue = 1000
          paybackSlider.continuous = true
          paybackSlider.tintColor = UIColor.blueColor()
          paybackSlider.value = 500
          paybackSlider.addTarget(self, action: "paybackSliderValueDidChange:",forControlEvents: .ValueChanged)
  
          self.view.addSubview(paybackSlider)
  
      }
  
      func paybackSliderValueDidChange(sender: UISlider!)
      {
          print("payback value: \(sender.value)")
          paybackLabel.text = "\(sender.value)"
  
      }
  
  
  }
  </code></pre>