uiwindow

Custom UIWindows do not rotate correctly in iOS 8

∥☆過路亽.° 提交于 2021-02-06 08:47:11
问题 Get your application into landscape mode and execute the following code: UIWindow *toastWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; toastWindow.hidden = NO; toastWindow.backgroundColor = [[UIColor cyanColor] colorWithAlphaComponent:0.5f]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [toastWindow removeFromSuperview]; }); In iOS 7 you will get a transparent blue overlay on top of the entire screen that

How to set an app's UIWindow color when calling it from ViewController

怎甘沉沦 提交于 2021-01-28 19:15:20
问题 In the App delegate, it is possible to set an app's UIWindow color as seen in the code. However, when trying to set an app's UIWindow color to a different color in the ViewController , a call for example to self.window?.backgroundColor = UIColor.blueColor() gets ignored. No errors occur, but no color change occurs either. Question: 1 - How can I set an app's window color when calling it in the ViewController ? Note: I'm not trying to change a View background color, but the UIWindow color

Custom UIWindow not showing

核能气质少年 提交于 2021-01-28 02:51:11
问题 I create a custom window let alertWindow = UIWindow(frame: UIScreen.mainScreen().bounds) let background = UIToolbar(frame: alertWindow.frame) background.barStyle = .Black background.translucent = true alertWindow.addSubview(background) alertWindow.makeKeyAndVisible() It only appears if I put the UIWindow variable as the global variable inside the AppDelegate. I see many Pods out there that using custom UIWindow for notification banner or custom AlertView. But they didn't put their custom

Custom UIWindow not showing

孤者浪人 提交于 2021-01-27 23:41:05
问题 I create a custom window let alertWindow = UIWindow(frame: UIScreen.mainScreen().bounds) let background = UIToolbar(frame: alertWindow.frame) background.barStyle = .Black background.translucent = true alertWindow.addSubview(background) alertWindow.makeKeyAndVisible() It only appears if I put the UIWindow variable as the global variable inside the AppDelegate. I see many Pods out there that using custom UIWindow for notification banner or custom AlertView. But they didn't put their custom

How to disable screen Recording in iOS app

我的梦境 提交于 2020-06-24 13:45:18
问题 Is there any way to disable the screen recording? or is is possible through a configuration profile? or any third party library is available? 回答1: NotificationCenter.default.addObserver(self, selector: #selector(preventScreenRecording), name: NSNotification.Name.UIScreenCapturedDidChange, object: nil) And create a view inside main view and prevent like that. (void) preventScreenRecording { if (@available(iOS 11.0, *)) { BOOL isCaptured = [[UIScreen mainScreen] isCaptured]; if (isCaptured) {

Setting Up CoreData with SceneDelegate - unknown identifier 'window' error - iOS 13 onwards

微笑、不失礼 提交于 2020-05-29 11:57:57
问题 I was trying to use the official apple documentation for Core Data. Found here. I also ran into a question which was related to my issue, right here on stack. I ran into an issue where, it kept saying that 'window' is not available in the context of AppDelegate. This is the very basic step as per the official documentation. func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { if let rootVC = window?

Advantages, problems, examples of adding another UIWindow to an iOS app?

安稳与你 提交于 2020-01-18 05:46:33
问题 Recently I've been wondering about the fact that that an iOS app only has one UIWindow . It does not seem to be an issue to create another UIWindow and place it on screen. My question is kind of vague, but I'm interested in: What could I potentially achieve with a second UIWindow that cannot be done in other ways? What can go wrong when using multiple UIWindow instances? I have seen that people use a 2nd UIWindow to display popover like views on iPhone. Is this a good way of doing it? Why?

The UIWindow's background application is jumping at the top of views when I switch from a view content to a UITableView

故事扮演 提交于 2020-01-16 03:49:05
问题 I am in charge to update an application in IOS8. But I have a problem when I want to switch between two view (the old and the new). The background of the UIWindow's Application jumped. It appears during 1 second and disappear. I can not find the issue. I tap on a backButton to change the content view. - (void)onBackTap { NSLog(@"Standard back"); [self goBackWithAnimation:AnimatePushFromLeft]; } - (void)goBackWithAnimation:(GraphNavigationAnimation)animation { NSLog(@"History Before ---> %@",

Why do I not see my new UIWindow?

橙三吉。 提交于 2020-01-15 08:55:47
问题 Scenario: Create and display an overlay (ancillary) UIWindow. Related Discussion: How do I toggle between UIWindows? Code: fileprivate func displayOverLay() { let myWindow = {() -> UIWindow in let cWindow = UIWindow(frame: CGRect(x: 10, y: 200, width: 300, height: 300)) cWindow.backgroundColor = UIColor.gray.withAlphaComponent(0.5) cWindow.tag = 100 return cWindow }() myWindow.makeKeyAndVisible() myWindow.windowLevel = UIWindowLevelAlert let storyboard = UIStoryboard(name: "Hamburger", bundle