title: Reset/Refesh UIscroll view
body: <p>I Have a scroll view that contains multiple view controllers. On those view controllers I have switches. When on switch is "on" all the other switches turn off. This is all done through the <code>viewDidLoad</code>. </p>
  
  <p>I cannot get this to work though, I have tried putting the code for the switch thingy stuff that I am trying to do in <code>viewWillAppear</code>. It seems though that these two methods are only called at run time.</p>
  
  <p>My alternative idea is to somehow "reset" the scroll view from inside one of the subviews</p>
  
  <p>here is what i have:</p>
  
  <pre><code>class ViewController: UIViewController {
  
  @IBOutlet weak var scrollView: UIScrollView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      let vc0 = ViewController0(nibName: "ViewController0", bundle: nil)
  
      self.addChildViewController(vc0)
      self.scrollView.addSubview(vc0.view)
      vc0.didMoveToParentViewController(self)
  
      let vc1 = ViewController1(nibName: "ViewController1", bundle:nil)
  
      var frame1 = vc1.view.frame
      frame1.origin.x = self.view.frame.size.width
      vc1.view.frame = frame1
  
      self.addChildViewController(vc1)
      self.scrollView.addSubview(vc1.view)
      vc1.didMoveToParentViewController(self)
  
      let vc2 = ViewController2(nibName: "ViewController2", bundle:nil)
  
      var frame2 = vc2.view.frame
      frame2.origin.x = self.view.frame.size.width * 2
      vc2.view.frame = frame2
  
      self.addChildViewController(vc2)
      self.scrollView.addSubview(vc2.view)
      vc2.didMoveToParentViewController(self)
  
      let vc3 = ViewController2(nibName: "ViewController3", bundle:nil)
  
      var frame3 = vc3.view.frame
      frame3.origin.x = self.view.frame.size.width * 3
      vc3.view.frame = frame3
  
      self.addChildViewController(vc3)
      self.scrollView.addSubview(vc3.view)
      vc3.didMoveToParentViewController(self)
  
      self.scrollView.contentSize = CGSizeMake(self.view.frame.size.width * 4, self.view.frame.size.height - 66);
   }
  }
  </code></pre>
  
  <p>^for the scrollUI creator class</p>
  
  <pre><code>import UIKit
  
  class ViewController0: UIViewController {
  
  @IBOutlet weak var onoff: UISwitch!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      onoff.on = false
  
  }
  
  @IBAction func used(sender: AnyObject) {
      let parent = self.view.superview
         parent?.setNeedsDisplay()
      }
  }
  </code></pre>
  
  <p>^this is one of the subclasses</p>
  
  <p>This subclass has a switch and when toggled, it should "reset" the scroll view so all of the subviews <code>viewDidLoad</code> are called again...</p>
  
  <p>This does not work.... Are there any solutions to this??</p>
  
  <p>BTW sorry for the bad formatting for the code blocks.</p>