title: How to auto-update app iOS app
body: <p>So I am making currency tracker ap for iOS. Currently I've managed to extract API of tracker and present it as nice label on my Main.storyboard. When I try to run my app I get latest currency value but it doesn't refresh itself after few minutes with new data. My question is how do I make app refresh itself every minute or so, so user can always be up to date with currency value.</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      getJSON { (usdPrice) -&gt; Void in
          let usdPriceText = usdPrice.description
          self.bitcoinValue.stringValue = usdPriceText
  
          print(usdPrice)
      }
  }
  
  func getJSON(completion: (Double) -&gt; Void) {
      let url = NSURL(string: baseURL)
      let request = NSURLRequest(URL: url!)
      let session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
      let task = session.dataTaskWithRequest(request) { (data, response, error) -&gt; Void in
  
          if error == nil{
              let swiftyJSON = JSON(data: data!)
              let usdPrice = swiftyJSON["bpi"]["USD"]["rate"].doubleValue
              completion(usdPrice)
          } else {
              print("There was an error!")
          }
      }
  
      task.resume()
      }
  
  
  
  
  }
  </code></pre>
  
  <p>Thanks a lot </p>