fix(ios): add @available(iOS 13.0, *) to UIApplication extension #3694
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UIWindowScene and connectedScenes APIs require iOS 13+, but the extension was missing the availability annotation, causing build errors when deployment target is below iOS 13.
Summary
Adds missing
@available(iOS 13.0, *)annotation toUIApplication+interfaceOrientation.swift.Problem
The extension uses
UIWindowSceneandconnectedScenesAPIs which require iOS 13+, but the extension is missing the availability annotation. This causes build errors:'UIWindowScene' is only available in iOS 13.0 or newer
While the VisionCamera podspec declares iOS 12.4 as minimum, this file uses iOS 13+ APIs without proper guards. When CocoaPods compiles the pod, it uses the pod's declared minimum (12.4), not the app's deployment target, causing the build to fail.
Why this matters
Users may be running older Xcode versions (e.g., 16.x) because they're not yet ready to migrate to React Native's new architecture and need to stay on older RN versions. These setups are more likely to surface this build error.
Alternative solution
Instead of adding
@available, the podspec minimum could be bumped to iOS 13.0. However, adding the annotation is more conservative and maintains backwards compatibility for any iOS12 users.
Changes
UIApplication+interfaceOrientation.swift: Added@available(iOS 13.0, *)to the extensionRelated issues
#3648, #3404, #3040