Last active
January 2, 2021 16:14
-
-
Save KrisRJack/5eb6cdd6ce7e1eb02167d2ef8e9f6961 to your computer and use it in GitHub Desktop.
Application Visible Window
This file contains 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
// | |
// Window.swift | |
// Created by Kristopher Jackson. | |
// | |
import UIKit | |
let window = UIApplication.shared.connectedScenes | |
.filter({$0.activationState == .foregroundActive}) | |
.map({$0 as? UIWindowScene}) | |
.compactMap({$0}) | |
.first?.windows | |
.filter({$0.isKeyWindow}).first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment