Реализация поддержки внешнего монитора в SwiftUIIOS

Программируем под IOS
Anonymous
Реализация поддержки внешнего монитора в SwiftUI

Сообщение Anonymous »


I'm confused about implementing external monitor support via Airplay with SwiftUI.

In SceneDelegate.swift I'm using UIScreen.didConnectNotification observer and it actually detects a new screen being attached but I'm unable to assign a custom UIScene to the screen.

I found a few good examples using Swift with iOS12 and lower, but none of them work in SwiftUI, since the whole paradigm has been changed to use UIScene instead of UIScreen. Here's the list:

https://www.bignerdranch.com/blog/addin ... usly-easy/

https://developer.apple.com/documentati ... ted_screen

https://www.swiftjectivec.com/supportin ... -displays/

Apple even spoke about it last year

Perhaps something changed and now there is a new way to do this properly. Moreover, setting UIWindow.screen = screen has been deprecated in iOS13.

Has anyone already tried implementing an external screen support with SwiftUI. Any help is much appreciated.


Источник: https://stackoverflow.com/questions/580 ... in-swiftui

Вернуться в «IOS»