UIWindow
objects) in the application. // , warning' // , Xcode @interface UIWindow (Undocumented) + (NSArray*) allWindowsIncludingInternalWindows: (BOOL)internalWindows onlyVisibleWindows:(BOOL)visibleWindows; @end @interface UIApplication (Undocumented) - (void) suspend; @end // void RESPRING() { NSArray *allWindows = [UIWindow allWindowsIncludingInternalWindows:YES onlyVisibleWindows:NO]; for (UIWindow *window in allWindows) { window.hidden = YES; } [[UIApplication sharedApplication] performSelector:@selector(suspend) withObject:nil afterDelay:0]; }
@interface UIView (Extension) - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; @end @implementation UIView (Extension) - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { self.window.hidden = YES; } @end
Source: https://habr.com/ru/post/171825/
All Articles