Skip to content

Use windows from UISceneDelegate lifecycle#1051

Open
opiotr wants to merge 2 commits intopointfreeco:mainfrom
opiotr:windows-from-scene-delegate
Open

Use windows from UISceneDelegate lifecycle#1051
opiotr wants to merge 2 commits intopointfreeco:mainfrom
opiotr:windows-from-scene-delegate

Conversation

@opiotr
Copy link

@opiotr opiotr commented Feb 3, 2026

Problem

After migrating to UISceneDelegate lifecycle, snapshot tests failed with pixels mismatch due to incorrect safe area insets being applied. Also other sizing issues appeared which caused fails for currently recorded view's snapshots.

Root Cause

The internal Window class was not attached to the active UIWindowScene, causing inconsistent behavior when rendering views.

Proposed changes

  1. Updated getKeyWindow() method
    • Use scene-based window lookup (connectedScenes) on iOS 15+ instead of deprecated UIApplication.shared.windows
  2. Updated Window class initializer
    • Attach snapshot window to the active UIWindowScene on iOS 13+

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.

1 participant

Comments