Created
September 5, 2018 11:14
-
-
Save kingiol/ef49309ea594bee7677e0a41832b9973 to your computer and use it in GitHub Desktop.
Get UIWindow
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
// - (UIWindow *)frontWindow { | |
// #if !defined(SV_APP_EXTENSIONS) | |
// NSEnumerator *frontToBackWindows = [UIApplication.sharedApplication.windows reverseObjectEnumerator]; | |
// for (UIWindow *window in frontToBackWindows) { | |
// BOOL windowOnMainScreen = window.screen == UIScreen.mainScreen; | |
// BOOL windowIsVisible = !window.hidden && window.alpha > 0; | |
// BOOL windowLevelSupported = (window.windowLevel >= UIWindowLevelNormal && window.windowLevel <= self.maxSupportedWindowLevel); | |
// BOOL windowKeyWindow = window.isKeyWindow; | |
// | |
// if(windowOnMainScreen && windowIsVisible && windowLevelSupported && windowKeyWindow) { | |
// return window; | |
// } | |
// } | |
// #endif | |
// return nil; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment