Questions tagged [uiwindowscene]
18 questions
45
votes
1 answer
How to use UIWindowScene.windows on iOS 15?
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: [link], applicationActivities: nil)
…

calebm
- 485
- 1
- 4
- 8
8
votes
2 answers
iOS 13/Facebook SDK error "Unable to find a valid UIWindow"
(To forestall well-intended suggestions, yes I posted this question last week on Facebook's developer forum. No responses yet.)
TL;DR
Facebook SDK 5.8 complains at startup FBSDKLog: Unable to find a valid UIWindow.
The Main Story
In a from-scratch,…

Andrew Duncan
- 3,553
- 4
- 28
- 55
4
votes
2 answers
How to get rid of message " 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead" with AdMob banner?
I want to get rid of the " 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead" message in my function (my function works very well by the way.).
The line of code involved:
banner.rootViewController =…

Flincorp
- 751
- 9
- 22
3
votes
3 answers
Xcode warning: 'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a relevant window scene instead
when updating my App's Deployment target to 15.0, i receive this warning:
'windows' was deprecated in iOS 15.0: Use UIWindowScene.windows on a
relevant window scene instead
I have tried to look on the net what could be done to remediate this, but…

Daniel C
- 113
- 1
- 8
2
votes
1 answer
How to use requestGeometryUpdateWithPreferences in Objective C
I have an example in Swift language:
guard let windowScene = view.window?.windowScene else { return }
windowScene.requestGeometryUpdate(.iOS(interfaceOrientations: .portrait)) { error in }
I can't write it in Objective C:
UIWindowScene…

Fleeploed
- 23
- 4
2
votes
0 answers
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: window, duration: 0.5, options:…

Arainty
- 91
- 9
2
votes
1 answer
iOS 15 UIWindowScene not working properly
I wanted to create an app for CarPlay, unfortunately the lack of tutorials gives me a hard time to even create an app without any functionality. The problem occurring when I want to start the application and it points to the AppDelegate.swift file.…

Donat Treszler
- 39
- 11
2
votes
2 answers
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 external screen stay black:
[Assert] Error in UIKit client:…

Fabio Magarelli
- 1,031
- 4
- 14
- 47
2
votes
1 answer
How to change the window title in a Mac Catalyst window scene?
I'm opening multiple scenes in the Mac Catalyst version of my iPad app. The problem is that all of the windows simply show my app name in each window title. This makes it confusing looking at the list of windows in the Window menu. Plus I want to…

rmaddy
- 314,917
- 42
- 532
- 579
1
vote
0 answers
iOS 16 can not change orientation correctly when other window exists
On iOS16, when force rotating the screen with the new API requestGeometryUpdate:errorHandler: to force rotation of the screen, if there are other UIWindow on the top of the current screen, the rotation will only take effect on the top window. Is…

Hayden Wang
- 21
- 2
1
vote
0 answers
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: 'keyWindow' was deprecated in iOS…
user15688965
1
vote
0 answers
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 add a button, check below code
public class…

Ankita Kalbande
- 11
- 1
1
vote
1 answer
How to get rootViewController in iOS 13 using Objective-C?
I'm trying to get the rootViewController in iOS 13 using Objective-C. I'm doing something like this:
for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {
UIWindowScene *windowScene = (UIWindowScene *) scene;
…

pableiros
- 14,932
- 12
- 99
- 105
1
vote
0 answers
UIWindowScene AVPlayerViewController orientation issue ios 13
IOS 13 bringed UIWindowScene. In my app i use next code to play the video:
let playerVC = AVPlayerViewController()
let asset = AVURLAsset(url: videoURL)
let item = AVPlayerItem(asset: asset)
playerVC.player = AVPlayer(playerItem:…

Nike Kov
- 12,630
- 8
- 75
- 122
0
votes
0 answers
How to limit a UIWindowScene to create only one window?
One of my apps uses two UIWindowScene configurations. One of these two configurations is the main view of the app. I want to limit the number of windows for the main view to just one. So essentially I want a classic 'one main window' and 'multiple…

Ely
- 8,259
- 1
- 54
- 67