648
questions
1
vote
1
answer
174
views
why does write addSublayer twice to block screenshot in swift?
I found an extension function to block screeenShot in iOS.
But I wounder to know why addSublayer twice.
self.layer.superlayer?.addSublayer(textfield.layer)
textfield.layer.sublayers?.last?....
1
vote
1
answer
1k
views
SwiftUI detect top notch and safe area insets
I am looking for a pure SwiftUI based solution to determine whether the iOS device has top notch based on the safe area insets of the root view. While this is easy to determine in UIKit, for SwiftUI ...
2
votes
0
answers
65
views
How to bring UIView in front of keyboard in Xcode 14 | Swift?
I am trying to bring a UIView in front of keyboard. It is working fine when compiled and run using Xcode 13, but same piece of code isn't working in Xcode 14 (Using Xcode 14.2). Below is the code I am ...
0
votes
1
answer
34
views
"Remember User" in SignIn Screen does not direct to Main Screen in Swift. (window is nil)
After Sign In I want to remember user and should go to the main ViewController but it doesnt. I tried to check that my code works or not it seems work but it does nothing. I know it is working because ...
-1
votes
1
answer
208
views
How to make new opened UI windows in Unity automatically offset? Like Windows File Explorer dose?
I'm developing an Unity app which can use bookmark buttons open multiple internal browser windows. For now, I make the browser Prefab, and instantiate it for open multiples simultaneously. But the ...
2
votes
1
answer
2k
views
Is SceneDelegate mandatory? [duplicate]
The question says it all.
There's the following line in apple documentation,
Scenes are opt in, but you must support them if you want to display
multiple copies of your app’s UI simultaneously.
It's ...
1
vote
1
answer
746
views
UIWindow in SceneDelegate
Recently, I encountered a problem, which I have posted here, in stackoverflow. Apparently, the error was because a random UIWindow variable was used to display UI (and not the one in SceneDelegate).
...
1
vote
1
answer
165
views
How can i insert UIView between UIWindow and all the views it has and will contain in Swift
i have a music player in my project and i want to insert this music player bottom of application. Actually i'm insert it inside UIWindow perfectly but all views goes under this player and it blocks ...
0
votes
1
answer
54
views
A view jumps on top after a clicking on a button
My setup is a UITabBarController with two ViewControllers connected.
setup
On one of the ViewControllers I've added a ContainerView constrained to the tab bar with a Blue Subview and a button on a ...
0
votes
0
answers
54
views
External Display View Bounds to Match TV Resolution
I have my app set to be able to mirror to an AppleTV, and despite the constraints I have, about half of the bottom part of the PDF being displayed in the WKWebView is stretching past the bottom of the ...
0
votes
1
answer
100
views
External Display Crashing On Adding Subview
In my app, there is one small section that displays lyrics to songs (PDFs loaded in a WKWebView). What I want to be able to do, is when you mirror that screen to an Apple TV, still control it with the ...
1
vote
0
answers
130
views
Window hide doesn't deallocate memory
I have presented a custom UIWindow in order to show some screens. When I hide the window, the window instance doesn't free up. The underlying view controller also not getting released.
Custom window ...
3
votes
0
answers
434
views
Use overrideUserInterfaceStyle on all active windows
I have appearance settings in my app that look like that:
func changeInterfaceStyle(to mode: UIUserInterfaceStyle) {
guard let window = view.window else { return }
UIView.transition(with: ...
1
vote
1
answer
2k
views
How to modally present a ViewController from SceneDelegate?
I have an OnboardingViewController which available to access from app's settings in a modal style.
When a user opens the app first time I want to show him the OnboardingVC in the same modal style (...
1
vote
0
answers
5k
views
How can I get the last window using UIWindowScene.windows in iOS 15?
Going off this post which describes how to get the first window - has definitely helped me learned more about this spec, but it wasn't able to get me the solution I need. How to resolve: '...
0
votes
1
answer
754
views
UIApplication.shared.windows.first?.rootViewController?.present(alert, animated: true) Deprecated
I am trying to present an alert for password reset link sent through Firebase with this code inside a func, but it says deprecated and my alert is not showing.
Any help to solve?
Thanks!
func ...
0
votes
1
answer
862
views
Is there a UIWindow resize event for an IOS app under MacOS on Apple M1
Running an IOS app under MacOS on an Apple M1 processor:
We are looking for a way to be notified when the app's window is resized by the user.
0
votes
1
answer
188
views
iOS. Interface orientation on launch
I have an app that supports both portrait and landscape.
So in Info.plist / Project Settings I specify both orientations.
In my UIViewController I override supportedInterfaceOrientations to return ....
1
vote
1
answer
238
views
Assert Window should be nonnil (Swift Error)
When PageController trying to present it's content I'm encountering following message in console:
"[Assert] Window should be nonnil here unless a subclass is mistakenly sending this to a child ...
1
vote
0
answers
299
views
Setting up a UIWindowScene for external display is always null
I'm trying to show a separate UIView on an External display. Before iOS 13 you could mirrored_window.screen = mirrored_screen
However, starting with iOS 13 that .screen setter has been deprecated. So ...
1
vote
1
answer
833
views
WKWebView does not receive touch events
I am trying to make a floating WKWebview. I want that user can interact with the WKwebview over all the other ViewControllers and that is why I put it inside a second UIWindow. The problem is that it ...
2
votes
1
answer
2k
views
SwiftUI - Display view on UIWindow
I'm trying to display a custom SwiftUI view similar to a Toast in Android.
My issue is that I would like to display this particular view above everything else, using the current UIWindow.
Currently, ...
4
votes
1
answer
1k
views
iOS 15 RC UIWindow makeKeyAndVisible will have black screen appeared
I tried iOS 15 RC version in my device iPhone 12, and found when I call window.makeKeyAndVisible, sometimes the window will change to black and back immediately.
It happened only on real device not ...
0
votes
1
answer
676
views
How to hide Keyboard which is in another window? Swift
I have a framework, which has a new window and and in that window, I have a button. Now I have imported that framework in my Host app, and now I have a floating button. So now when I tap on that ...
60
votes
1
answer
58k
views
How to use UIWindowScene.windows on iOS 15? [duplicate]
Currently, with iOS 14.6, I can call a function in my app that displays a share sheet using the following code:
func share(link: URL) {
let activityView = UIActivityViewController(activityItems: [...
1
vote
0
answers
175
views
iOS 12 Crash FBSDisplayIdentity
According to Crashlytics, this issue only on iOS 12, I can't to reproduce that.
There is an assumption that this is due to the toolbar for the keyboard, but what exactly the problem is is not clear.
...
1
vote
0
answers
204
views
How can I use a custom UIWindow in order to override the sendEvent function?
SNWindow is a custom class I made with a custom delegate which overrides the sendEvent function.
In previous versions of iOS (when there was no SceneDelegate) I used to insert this code in the ...
2
votes
0
answers
569
views
Prevent user from dismissing Apple Pay's dialog PKPaymentAuthorizationViewController
I'm adding PKPaymentAuthorizationViewController to my app. I present it, and after the payment method is authorized, I get the token at didAuthorizePayment method as expected.
At this point, I make an ...
0
votes
1
answer
50
views
TabBar visibility issue after window root change
After entering to the foreground I am performing a request, during which I am changing the root view controller of the main window to a fake launch screen like view controller, temporarily keeping the ...
0
votes
1
answer
619
views
How to add view to UIWindow but below view controller which present over?
How to add view to UIWindow but below viewcontroller which present over ?
In iOS 13 +, It already have behavior like that (add view to window, it will not over viewcontroller which open by modal ...
0
votes
1
answer
149
views
Failed to disable UserInteraction on UIView added on UIWindow
So here is the problem. I have created a custom loader which shows a basic "loading" text in the middle with dimmed background. The HUD shows just fine but despite of setting ...
0
votes
1
answer
874
views
Are viewcontroller llfecycle events suppose to be called when app is launched into background?
I always knew that window?.makeKeyAndVisible() is to be done within didFinishLaunching
But I also thought non of the root viewcontroller’s life cycle events would get called until app is foregrounded. ...
-2
votes
1
answer
88
views
getting bugs with viewController instantiation from SceneDelegate
So my goal is to be able to show the right vc without any bugs. There's actually multiple bugs with this issue. First it would make sense to show the block of code and explain it first so you can get ...
0
votes
1
answer
318
views
how to get full viewController back when instantiating from SceneDelegate
So in my last question, I was trying to instantiate from the AppDelegate, but it wasn't working, so after doing more research I kept seeing SceneDelegate and decided to give it a try. To my surprise ...
2
votes
1
answer
3k
views
How do I add a view to the top of an app in iOS 13/14
I'm trying to add a view to my app that is persistent across flows and sits above all other views. In previous versions of iOS i've been able to simply add a subview to the UIWindow that sat atop my ...
0
votes
0
answers
361
views
iOS13+ Creating a constant button on top of every screen
I maintain an app SDK that contains a button which should always be displayed on top of all screens in the application, but this functionality broke with iOS 13+ which seems to have changed some ...
0
votes
1
answer
167
views
How can I add a subview under statusbar and on top of Navigationbar in iOS?
I am trying to add a subview in between statusbar and navigationbar, so I have set the y position = 0 and after that I am reducing UIApplication Keywindow size so that it would free up space on top.
...
3
votes
0
answers
886
views
App is not loading and getting XPC connection was invalidated error in iPhone OS 14.2
I am trying to run my App on my iPhone 6S OS Version 14.2 using my Xcode Version 12.2
The problem is while installing the App, the App got stuck in Launch screen, seems like getting blank screen and ...
6
votes
0
answers
825
views
Why is `viewDidAppear` method called again on previous root view controller when swapping root view controller on window?
In a project a root view controller is being swapped at some point to recreate a whole window hierarchy. A pretty standard code is called simply using
windows.rootViewController = newController
but ...
1
vote
0
answers
194
views
How to add subview to UIWindow Scene iOS 13
I have created a in house framework which works perfectly fine till iOS 12, as I am adding a button (floating button) on window so that it is visible on entire app.
I have created a UIWindow class to ...
1
vote
0
answers
780
views
Configuring a UIViewController outside scene(_:willConnectTo:options:) then setting it to window rootViewController doesn't work
My intention is to initialize a view controller and set it to the window rootViewController, then pass the view controller as dependency to an AppCoordinator where the app decide what to do with the ...
1
vote
2
answers
1k
views
How to fix the position of the window in Mac catalyst?
Every time i open my project it opens in a random position in window. I want to fix the position for example it’s frame (x,y,width,height ) is this possible ?
0
votes
1
answer
1k
views
Swift -Position new UIWIndow in center of Screen
The user taps a cell, I get the touchLocation, create and then animate a new UIWindow to the center of the screen. The problem is when the new window (purple) appears on screen instead of its center ...
1
vote
0
answers
48
views
Status bar labels turn white after setting UIWindow's rootViewController
Some times after doing this
if let window = UIApplication.shared.keyWindow {
window.rootViewController = HomeTabBarController()
}
I get this kind of visual of status bar status bar visual
it ...
3
votes
1
answer
697
views
How to create an UIWindow with Vibrant background in MacCatalyst?
We can create this effect easily with NSWindow and NSVisualEffectView in native mac app but how can we do it in app that was built for MacCatalyst?
of course setting alpha = 0 for UIWindow and add an ...
2
votes
2
answers
1k
views
Accessing NSWindow-like properties in Catalyst macOS app
I am thinking about porting my macOS app to Catalyst.
My app shows a transparent window (no title bar, clear background) on top of all other apps windows (dock included).
To do that, in the non-...
2
votes
2
answers
3k
views
Setter for 'screen' was deprecated in iOS 13.0
I was trying to follow this tutorial to create a multi screen application:
https://www.youtube.com/watch?v=UYviLiI2rlY&t=774s
Unfortunately at min 25:00 - 26:00 I receive an error and my ...
0
votes
1
answer
1k
views
UIWindow and it's content not showing in Xcode 11 iOS 13. Getting black screen
I had Swift project which was developed in Xcode 10.2 and it was working fine. I had migrated my code from Xcode 10.2 to Xcode 11.3. Since after this my app is not working properly. Whenever I tries ...
-1
votes
1
answer
8k
views
'keyWindow' is deprecated: first deprecated in iOS 13.0 in Objective-C [duplicate]
This is my simple button action to show a XIB file which is actually a bar code scanner in Objective-C.
- (IBAction)startCamera:(id)sender {
BarcodeVC * controller = [[BarcodeVC alloc] ...
0
votes
0
answers
92
views
iOS: Assigning new Window in iOS app is showing black screen for a moment?
I am trying to solve app routing problem. I need to navigate to some screen when user tap on some notification or click on any button (for eg X) from anywhere in app (might be in middle of stack of ...