Questions tagged [keywindow]

28 questions
5
votes
1 answer

Creating new UIWindows, taking over key window -- bad practice?

I'm working on an app which needs to display an overlay an top of everything else. It does this by creating a new UIWindow, and using makeKeyAndVisble to "take over" the screen. When it's done, it gives control back back to the original UIWindow. Is…
Anna Dickinson
  • 3,217
  • 21
  • 42
4
votes
1 answer

iOS 13 isKeyWindow always returns nil

I am wondering why: UIApplication.shared.windows.first { $0.isKeyWindow } always returns nil both in the simulator and on device. You can confirm this by putting a break point in viewDidLoad in any view controller and printing the object to the…
Adam Dahan
  • 51
  • 3
3
votes
2 answers

keyWindow does not always return a UIWindow

I have been using [[UIApplication sharedApplication] keyWindow] to get the visible view of the screen in the form of a UIView. I then convert that view into a UIImage to work with. This is working great except in the case where I show a UIAlertView…
Jordan H
  • 45,794
  • 29
  • 162
  • 306
2
votes
0 answers

UIWindow subview disappear immediately on ios 13

I am upgrading my app to use iOS 13. I have been using a UIWindow to add image to the current screen. However in ios 13 the image will appear, but then disappear straight away. I tried building in previous version, which is ios 12.2, and it's…
2
votes
1 answer

How to Present a Modal above a View that was added to keyWindow?

I have added a view to [[UIApplication sharedApplication] keyWindow], because we want it to overlap the navigation bar. Now we want to tap a button on the view and open a window modally, ideally by using presentViewController. Is there a way to…
Chris
  • 5,199
  • 15
  • 61
  • 124
2
votes
1 answer

keyWindow = nil only on iPad

I got a problem with my applications keyWindow on iPad. I designen my app for iPhone and added the iPad support later by setting the device family and adding a new storyboard for iPad. Everything is fine so far, I can open the app on the ipad and…
E. Lüders
  • 1,455
  • 1
  • 12
  • 27
1
vote
1 answer

UIAlertController in iOS 8.x cannot response touch event, is the touch event sent to the key window object?

I have a problem abount UIAlertController. It cannot receive any touch events and be dismissed. I persent the alert in this way: UIViewController *controller =[UIApplication sharedApplication].keyWindow.rootViewController [controller…
gcmiao
  • 11
  • 4
1
vote
2 answers

NSBorderlessWindowMask Subview NSTextfield not keybard editable Swift

I'm using a NSBorderlessWindowMask for my main window on a Swift project (without storyboards), when I load a Subview, the NSTextfield outlet is not keybard editable. I already put this code on the…
PhiceDev
  • 477
  • 1
  • 5
  • 21
0
votes
0 answers

Adding Offline View line on window but Hide after any navigation swift

I want to add offline label when user dont have internet connection or wifi.here is my code private func createOfflineView(){ offlineView.frame = CGRect(x: 0, y: 0, width: UIWindow(frame: UIScreen.main.bounds).frame.width, height: 30) …
Jigar
  • 1,703
  • 1
  • 12
  • 28
0
votes
0 answers

UIApplication key window 'safe area layout guide" excludes tab bar & navigation bar

I am trying to showing a toast view on top and bottom of my view controller. However, the "Safe Area Layout" guide is neither including the navigation bar or the tab bar at the bottom. The status bar is included. I want to show the toast view below…
0
votes
1 answer

unable to access UIApplication.SharedApplication.KeyWindow during the launch of the app as keywindow is always null

When my app is launched i show the Storyboad with an image in it like a splash screen. Then i call LoadApplication(new App()) from FinishedLaunching() method in AppDelegate class. In my App.cs, I need to access…
0
votes
1 answer

Swift iOS -View Controller deinit runs when adding it to a new keyWindow

I have a view controller (OrangeVC) that I add to a class that contains a new keyWindow(NewKeyWindowClass). A button in a different vc is tapped and it triggers this new window to get shown over the app's main window and it animates from the right…
Lance Samaria
  • 11,429
  • 8
  • 67
  • 159
0
votes
1 answer

How to show view on the keywindow after UIAlertController

I want to do a save image function, after the success of the pop-up tips. When I press the picture pop-up alertController, save the success did not see the prompt box displayed on the keywindow, what is going on ? //show the tip of…
代思思
  • 13
  • 5
0
votes
0 answers

How to add UICollectionView as a sub view of an application keyWindow

I try to add a an UICollectionView as a subview of a keywindow so that this collectionview is visible in every ViewController of my application.So how can I add collection view on keywindow and how or which class is used for updating in future?
Rumy
  • 167
  • 1
  • 13
0
votes
3 answers

KeyWindow add subView, did not shows in the front

I use keyWindow to add a subView, it add success but did not shows in the front of the screen hierarchy. The deep gray view is my added view: My code is: @interface ViewController () { LMLUpspringView *pop_v; } @end @implementation…
s-n-2
  • 337
  • 1
  • 5
  • 20
1
2