Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iOS-app crashing when connecting an external display #168

Conversation

DanielKuhn
Copy link
Contributor

@DanielKuhn DanielKuhn commented Feb 14, 2024

External display connection invokes scene:willConnectTo:options again with the session role .windowExternalDisplayNonInteractive:https://developer.apple.com/documentation/uikit/windows_and_screens/presenting_content_on_a_connected_display

This needs to be explicitly handled or rejected, otherwise the app crashes with the error:
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time!'

External display connection invokes
scene:willConnectTo:options again with the
session.role .windowExternalDisplayNonInteractive:
https://developer.apple.com/documentation/uikit/windows_and_screens/presenting_content_on_a_connected_display

This needs to be explicitly handled or rejected,
otherwise the app crashes with the error:
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency',
reason: 'A view can only be associated with at most one view controller at a time!"
@DanielKuhn DanielKuhn changed the title fix: iOS-app crashing when connecting an external display Fix iOS-app crashing when connecting an external display Feb 14, 2024
@DanielKuhn
Copy link
Contributor Author

DanielKuhn commented Feb 14, 2024

This should also be updated in the README - maybe while converting the example code in the README to Swift.

@birkir birkir merged commit 73d3185 into birkir:master Feb 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants