title: How do i make a global variable with data from an action, with swift
body: <p>I want to make a global variable with the data from "sliderValue" how do I do that</p>
  
  <pre><code>@IBOutlet weak var label: UILabel!
  override func viewDidLoad() {
      self.view.backgroundColor = UIColor(red: 66.0/255, green: 150.0/255, blue: 65.0/255, alpha: 1.0)
  }
  
  @IBAction func slider(sender: UISlider) {
      var sliderValue = lroundf(sender.value)
      label.text = "\(sliderValue)"
  }
  </code></pre>