title: ios continuously check to see if request succeeds
body: <p>I have a concept of an <code>offline mode</code> in my app. Whenever a request fails due to connectivity issues, or a 500 response from my server, I automatically put my app into <code>offline mode</code>. I then save the <code>request</code> which triggered the offline mode, and in the next successful request I make, I re-run the original request that failed. If the request succeeds this time, I take the application out of <code>offline mode</code>.</p>
  
  <p>The issue with this mechanism is that it requires the user to perform an action to trigger a successful api call that subsequently then re-sends the original request. I want to know the best way I can continuously send the request on its own thread and listen for a successful response. </p>
  
  <p>I am fairly new to ios development so looking to be pointed towards some best practices around this scenario. </p>
  
  <p>Thanks!</p>