From the course: iOS Development: Security
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Clearing data before moving to the background - iOS Tutorial
From the course: iOS Development: Security
Clearing data before moving to the background
- [Instructor] As recommended by Apple, sensitive information should be removed from views before moving the app to the background. If you want to find out more, you can visit this web page. All right, now let's implement this behavior in our app. I switch to the ViewController. I'm going to register the ViewController as an observer for the UI application willResignActive notification. This notification gets fired when the app is about to move to the background. I do that in the viewDidLoad method and we call NotificationCenter.default.addObserver and pass in the Notification.Name we're interested in. That is Notificatoin.Name.UIApplicationWillResignActive. The object argument is the object that sends the notification. We use nil which means that we accept this notification from any sender. The queue is the OperationQueue to which the block to be executed is added. I'm going to use the main OperationQueue since we want to perform UI-related methods. Finally, we need to implement the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Purpose strings2m 7s
-
(Locked)
Request authorization for system features4m 7s
-
(Locked)
Adding the missing purpose string1m 34s
-
Exposing sensitive data through copying and pasting2m 16s
-
(Locked)
The pasteboard spy app2m 24s
-
(Locked)
Prevent pasteboard leakage without coding1m 11s
-
(Locked)
Prevent pasteboard leakage with coding2m 11s
-
(Locked)
Using an app-specific pasteboard5m 33s
-
(Locked)
Data leakage through app screenshots2m 16s
-
(Locked)
Clearing data before moving to the background3m 7s
-
(Locked)
Obscuring the snapshot before moving to the background3m 30s
-
(Locked)
Hacking the UserDefaults4m 40s
-
(Locked)
-
-
-
-
-