In the app that I'm making, the user will be only able to do a task every 2 hrs. How do I keep track of the 2 hrs even if the app is closed and not running?

Please give an answer in Swift. Here is my code so far

```
@IBAction weak var button(sender: AnyObject) {        
    if timer >= 2 hrs {    
       println("OK")    
    }    
    else {
       println("Please wait 2 hrs before continuing")
    }
}

```