title: UISlider slider value not saving
body: <p>I'm working on a simple app that allows the user draw using one of four provided colors and share/export their work. To change the brush size, you must enter a "settings" view and adjust it via slider. The problem I'm having is that the value of the slider does not affect the size of the brush upon returning to the main view. Whatever I set the initial brush size to be, thats how it remains no matter how many times I mess with the slider.
  <br>
  The two views are managed by a NavigationViewController if that makes a difference.</p>
  
  <h1>Main/Drawing View Controller</h1>
  
  <pre><code>import UIKit
  
  class DrawingViewController: UIViewController {
  
  @IBOutlet weak var imageView: UIImageView!
  @IBOutlet weak var buttonsStackView: UIStackView!
  
  var lastPoint = CGPoint.zero
  var red : CGFloat = 0.0
  var green : CGFloat = 0.0
  var blue : CGFloat = 0.0
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  
      NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(DrawingViewController.appBecameActive), name: UIApplicationDidBecomeActiveNotification, object: nil)
  
      blueTapped(UIButton())
  }
  
  func appBecameActive() {
      self.buttonsStackView.hidden = false
  }
  
  override func viewWillAppear(animated: Bool) {
      self.navigationController?.navigationBarHidden = true
      print("Current Brush Size: \(SettingsViewController().brushSize)")
  }
  
  override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
      if let touch = touches.first {
          let point = touch.locationInView(self.imageView)
          self.lastPoint = point
      }
  
      self.buttonsStackView.hidden = true
  }
  
  override func touchesMoved(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
      if let touch = touches.first {
          let point = touch.locationInView(self.imageView)
          //print("Point: \(point)")
  
          drawBetweenPoints(self.lastPoint, secondPoint: point)
  
          self.lastPoint = point
      }
  
  }
  
  override func touchesEnded(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
      if let touch = touches.first {
          let point = touch.locationInView(self.imageView)
          //print(point)
  
          drawBetweenPoints(self.lastPoint, secondPoint: point)
      }
  
      self.buttonsStackView.hidden = false
  }
  
  func drawBetweenPoints(firstPoint:CGPoint, secondPoint:CGPoint) {
      UIGraphicsBeginImageContext(self.imageView.frame.size)
      let context = UIGraphicsGetCurrentContext()
  
      self.imageView.image?.drawInRect(CGRect(x: 0, y: 0, width: self.imageView.frame.size.width, height: self.imageView.frame.size.height))
  
      CGContextMoveToPoint(context, firstPoint.x, firstPoint.y)
      CGContextAddLineToPoint(context, secondPoint.x, secondPoint.y)
  
      //randomTapped(UIButton())
      CGContextSetRGBStrokeColor(context, self.red, self.green, self.blue, 1.0)
      CGContextSetLineCap(context, .Round)
      CGContextSetLineWidth(context, CGFloat(SettingsViewController().brushSize))
  
      CGContextStrokePath(context)
  
      self.imageView.image = UIGraphicsGetImageFromCurrentImageContext()
  
      UIGraphicsEndImageContext()
  }
  
  func eraseEasel() {
      self.imageView.image = nil
  }
  
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
      if segue.identifier == "drawingToSettingsSegue" {
          let settingsVC = segue.destinationViewController as! SettingsViewController
          settingsVC.drawingVC = self
      }
  }
  
  @IBAction func blueTapped(sender: AnyObject) {
      self.red = 56 / 255
      self.green = 109 / 255
      self.blue = 229 / 255
  }
  @IBAction func greenTapped(sender: AnyObject) {
      self.red = 37 / 255
      self.green = 235 / 255
      self.blue = 114 / 255
  }
  @IBAction func redTapped(sender: AnyObject) {
      self.red = 229 / 255
      self.green = 56 / 255
      self.blue = 56 / 255
  }
  @IBAction func yellowTapped(sender: AnyObject) {
      self.red = 249 / 255
      self.green = 215 / 255
      self.blue = 23 / 255
  }
  @IBAction func randomTapped(sender: AnyObject) {
      self.red = CGFloat(arc4random_uniform(255)) / 255
      self.green = CGFloat(arc4random_uniform(255)) / 255
      self.blue = CGFloat(arc4random_uniform(255)) / 255
  }
  
  }
  </code></pre>
  
  <p><br></p>
  
  <h1>Settings View Controller</h1>
  
  <pre><code>import UIKit
  
  class SettingsViewController: UIViewController {
  
  weak var drawingVC : DrawingViewController? = nil
  
  @IBOutlet weak var brushSlider: UISlider!
  
  var brushSize : Float = 15
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view.
  
      self.navigationController?.navigationBarHidden = false
  }
  
  override func viewWillAppear(animated: Bool) {
      brushSlider.value = self.brushSize
  }
  
  @IBAction func eraseTapped(sender: AnyObject) {
      self.drawingVC?.eraseEasel()
      self.navigationController?.popViewControllerAnimated(true)
  }
  
  @IBAction func shareTapped(sender: AnyObject) {
      if let image = drawingVC?.imageView.image {
          let activityVC = UIActivityViewController(activityItems: [image], applicationActivities: nil)
          self.presentViewController(activityVC, animated: true, completion: nil)
      }
  }
  
  @IBAction func brushSlider(sender: AnyObject) {
      self.brushSize = brushSlider.value
      print(self.brushSize)
  }
  
  }
  </code></pre>