Created
September 29, 2015 10:10
-
-
Save haxpor/50c3ae54e69ebc6f87c8 to your computer and use it in GitHub Desktop.
Get the top UIWindow as seen in KLCPopup (https://github.com/jmascia/KLCPopup)
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
// Prepare by adding to the top window. | |
if(!self.superview){ | |
NSEnumerator *frontToBackWindows = [[[UIApplication sharedApplication] windows] reverseObjectEnumerator]; | |
for (UIWindow *window in frontToBackWindows) { | |
if (window.windowLevel == UIWindowLevelNormal) { | |
[window addSubview:self]; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment