title: How to set multiple UILabels from array in Swift?
body: <p>What I'm trying to do is to get today's weekday. From it I get the rest 6 weekdays, I put them into an array and then try to use this array to update 7 <code>UILabel</code>s. A short list of weekdays starting from today that is. My <code>UILabel</code>s are in a referencing outlet collection and I have set their tags from 0 to 6.</p>
  
  <p>I have tried multiple different versions (originally without any array) of this and have managed to make this work on Playground, up to the point that I have the weekdays in the array but on the actual project, when I try to update the labels, it builds successfully but then crashes.</p>
  
  <p>Edit: Crash comes after successful build. Error in Thread 1: breakpoint 1.1. Stops at the row super.viewDidLoad() apparently.</p>
  
  <p>Edit2: made changes as suggested. Build succeeds and then crashes in the same style as in first Edit.</p>
  
  <p>Any help is appreciated.</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      @IBOutlet var label: [UILabel]!
  
      var rollingDay = NSDate()
      var array: [String]  = []
  
      func addDays() {
          var calendar = NSCalendar.currentCalendar()
          var formatter = NSDateFormatter()
          var stringRolling = formatter.stringFromDate(rollingDay)
  
          for var x = 0; x&lt;7; x++ {
              calendar = NSCalendar.currentCalendar()
              formatter = NSDateFormatter()
              formatter.dateFormat = "EEEE"
              stringRolling = formatter.stringFromDate(rollingDay)
              array.append(stringRolling)
              rollingDay = calendar.dateByAddingUnit(.CalendarUnitDay, value: 1, toDate: rollingDay, options: nil)!
          }
      }
  func updateLabels() {
      for (index, day) in enumerate(array) {
          let label : UILabel = self.view.viewWithTag(index) as! UILabel
          label.text = day as String
      }
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      addDays()
      updateLabels()
  
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>