Body:
Hello,
I am facing a challenging issue with my SwiftUI iOS application, which is designed to work on an iPad and connect to an external display. The app, called "EasyJoin," is intended to provide a single-touch interface for joining conference meetings. It pulls events from a calendar and provides a "Join" button to connect to the meeting.
The Goal:
- Mirror the app on an external display in its native aspect ratio.
- Also mirror any other client applications launched from EasyJoin (such as Google Meet, Teams, WebEx, Zoom) to the external display in its native aspect ratio.
The Issue:
While I have been successful in displaying the app on the external display, the iPad screen goes black as soon as the external display is connected. I need both the iPad and the external display to show the app simultaneously, each in their native aspect ratios.
What I've Tried:
- Created separate
UIWindow
objects for the internal and external displays. - Used
NotificationCenter
to listen forUIScreen.didConnectNotification
andUIScreen.didDisconnectNotification
. - Tried managing windows through both
AppDelegate
andSceneDelegate
. - Explicitly set
windowLevel
for both internal and external windows.
Despite these efforts, the issue persists. The external display works as expected, but the iPad screen remains black.
Here is a snippet of my SceneDelegate.swift
:
// ... (Code for setting up UIWindow and listening for screen connect/disconnect)
@objc func screenDidConnect(notification: Notification) {
// ... (Code for setting up external UIWindow)
externalWindow?.isHidden = false
}
@objc func screenDidDisconnect(notification: Notification) {
externalWindow?.isHidden = true
externalWindow = nil
}
I would appreciate any guidance or suggestions to resolve this issue. Thank you!
Feel free to copy and paste this into a new post on the Apple Developer Forums. Hopefully, you'll get some specialized assistance that can help resolve the issue.