Last active
July 11, 2020 23:44
-
-
Save felipericieri/1366f4971a8437447d2ede40e8b2b639 to your computer and use it in GitHub Desktop.
Using Additional Window to hide sensitive data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@UIApplicationMain | |
class AppDelegate: UIApplicationDelegate { | |
var window: UIWindow? | |
private lazy var backgroundWindow: UIWindow = { | |
let screen = UIScreen.main | |
let window = UIWindow(frame: screen.bounds) | |
window.screen = screen | |
window.rootViewController = BlockViewController() | |
window.windowLevel = .alert | |
return window | |
}() | |
// MARK: - App | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
// Setup your app here ... | |
return true | |
} | |
// MARK: - Handling Application Background State | |
func applicationDidEnterBackground(_ application: UIApplication) { | |
backgroundWindow.isHidden = true | |
} | |
func applicationWillEnterForeground(_ application: UIApplication) { | |
backgroundWindow.isHidden = false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment