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.

Obscuring the snapshot before moving to the background

Obscuring the snapshot before moving to the background - iOS Tutorial

From the course: iOS Development: Security

Start my 1-month free trial

Obscuring the snapshot before moving to the background

- [Instructor] We can prevent the leakage of sensitive data also by powering Snapshot view with the generic screen. The benefit of this solution is that we don't have to remove the content of our views. Besides, we can implement the required logic in the app delegate. Instead of adding the notification-based solution to all the affected view controllers. So I start by removing the notification-related code. Let's get rid of the, you will disappear, and also let's remove the addObserver code. Now let's switch to the AppDelegate. We'll need a view that's based on top of the current view before the app moves to the background. So first, I create the lazy variable, lazy var, and then called splashView. It's of type UIImageView, and now let's initialize it. We'll keep it simple for this demo, so I create the UIImageView that covers the entire window. I create a constant, let imageView equals UIImageView I create a constant, let imageView equals UIImageView and I'm going to initialize it…

Contents