Prevent iOS from taking screen capture of app before going into background

You are on the right track. This is Apple’s recommended way to do this as noted in the iOS Application Programming Guide: Remove sensitive information from views before moving to the background. When an application transitions to the background, the system takes a snapshot of the application’s main window, which it then presents briefly when … Read more

Does using Tasks (TPL) library make an application multithreaded?

Tasks can be used to represent operations taking place on multiple threads, but they don’t have to. One can write complex TPL applications that only ever execute in a single thread. When you have a task that, for example, represents a network request for some data, that task is not going to create additional threads … Read more

How to handle background audio playing while iOS device is locked or on another application?

Playing Background Audio An app that plays or records audio continuously (even while the app is running in the background) can register to perform those tasks in the background. You enable audio support from the Background modes section of the Capabilities tab in your Xcode project. (You can also enable this support by including the … Read more

Proper use of beginBackgroundTaskWithExpirationHandler

If you want your network transaction to continue in the background, then you’ll need to wrap it in a background task. It’s also very important that you call endBackgroundTask when you’re finished – otherwise the app will be killed after its allotted time has expired. Mine tend look something like this: – (void) doUpdate { … Read more

Handling applicationDidBecomeActive – “How can a view controller respond to the app becoming Active?”

Any class in your application can become an “observer” for different notifications in the application. When you create (or load) your view controller, you’ll want to register it as an observer for the UIApplicationDidBecomeActiveNotification and specify which method that you want to call when that notification gets sent to your application. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(someMethod:) … Read more