title: Update View every day
body: <p>looking for a possibility to update the view every day.</p>
  
  <p>this is what I have tried... but it doesn't even print "test2"</p>
  
  <pre><code>var WordNumber = 0
  override func viewDidLoad() {
      super.viewDidLoad()
      let userDefault = UserDefaults.standard
      if let lastRe = userDefault.dictionary(forKey: "lastRe") {
          print("test2")
          if let letztesDatum = lastRe ["date"] as? NSDate {
              print("test3")
              if let index = lastRe ["index"] as? Int {
                  print("test4")
                  if abs(letztesDatum.timeIntervalSinceNow) &gt; 1 {
                      print("test5")
                      WordNumber = index + 1
                      let  _ : [NSObject : AnyObject] = ["date" as NSObject : NSDate(),
                                                         "index" as NSObject : WordNumber as AnyObject]
                  }
                  print("test6")
                  nextDay() //update lbl
                  userDefault.set(lastRe, forKey: "lastRe")
                  userDefault.synchronize()
              }
          }
      }
  }
  </code></pre>