I need to upload files to a server in an iOS app. I would like this to occur while the app is running, but in a concurrent manner (on a separate thread) so the upload is invisible to the user of the application.
Running anything in the "background" seems to complex, so I want to make sure I get the question right. What I would like to know is:
1) While the app is in the foreground, can I have a "background thread" that contains a timer that will upload data to the server as the data becomes available?
2) If so, what will happen to the upload task when another application is brought to the foreground by the user?
3) If so, what are the best practices for implementing this type of concurrency? Coming in cold, a thread would be the first thing I would consider, but there may be better, simpler ways to accomplish this.
Thanks for the help!