-
Notifications
You must be signed in to change notification settings - Fork 0
Fix iOS 13.0 keyWindow deprecation warning #7
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
base: master
Are you sure you want to change the base?
Conversation
- Add UIApplication extension with keyRootViewController property - Replace deprecated keyWindow calls with keyRootViewController - Fixes #6 Co-authored-by: leesam <2sem@users.noreply.github.com>
Pull Request ReviewSummaryThis PR addresses the iOS 13.0 deprecation warning for Code Quality & Best Practices✅ Positive Points
|
|
@claude thereviewer mentioned UIApplication.shared.connectedScenes
.first(where: { $0.activationState == .foregroundActive }) |
|
Claude finished @2sem's task in 1m 34s —— View job Implemented foregroundActive scene selection ✓I've successfully implemented the reviewer's suggestion to improve multi-scene handling in the Changes MadeImproved Scene Selection Logic (GADManager/GADManager.swift:14-35)
Enhanced Code Quality
Implementation DetailsThe new implementation follows a two-tier approach:
This approach addresses the critical race condition issue identified in the review where Completed Tasks
|
- Added foregroundActive scene selection logic for better multi-scene app support - Added fallback to any connected scene if no foreground active scene exists - Changed extension access level to private to avoid namespace pollution - Added comprehensive documentation comments Co-authored-by: leesam <2sem@users.noreply.github.com>
Code Review: Fix iOS 13.0 keyWindow deprecation warningSummaryThis PR successfully addresses the iOS 13.0 deprecation warning for ✅ Strengths
🔍 Code Quality & Best PracticesIssue 1: Redundant
|
|
@claude we have already UIApplication+.swift |
|
Claude finished @2sem's task in 1m 1s —— View job Analysis of UIApplication extension placementThanks for pointing that out! I've reviewed both files and you're absolutely right - there's already a dedicated file for UIApplication extensions. Current SituationExisting file:
Current PR implementation:
RecommendationThe
Implementation ApproachSince the extension is marked Option A: Keep it private (recommended for this use case) // In UIApplication+.swift, add at the bottom:
/// Private extension for internal GADManager use only
private extension UIApplication {
/// Returns the root view controller of the key window in the active scene.
/// For multi-scene apps, prioritizes the foreground active scene with fallback logic.
/// - Returns: The root view controller, or nil if no valid scene/window is found.
var keyRootViewController: UIViewController? {
// Current implementation...
}
}Option B: Make it internal/public Additional NotesWhile reviewing, I also noticed the same issues from my previous review still apply:
Would you like me to:
Todo List
|
|
@claude Move the extension to UIApplication+.swift keeping it private |
|
Claude finished @2sem's task in 1m 40s —— View job Successfully moved keyRootViewController extension ✓Changes MadeRefactored Extension Location (Commit: 5e96586)
Benefits
Files Changed
The extension retains all its functionality:
|
- Moved private extension from GADManager.swift to UIApplication+.swift - Fixed UIApplication.shared to use self within extension - Improves code organization by consolidating UIApplication extensions Co-authored-by: leesam <2sem@users.noreply.github.com>
Code Review - PR #7: Fix iOS 13.0 keyWindow deprecation warningSummaryThis PR successfully addresses the iOS 13.0 deprecation warning for ✅ Strengths
🔍 Code Quality & Best PracticesGood:
Suggestions:
🐛 Potential IssuesCritical:
⚡ Performance Considerations
🔒 Security ConcernsNo security issues identified. The changes are purely related to UI window management. 🧪 Test CoverageMissing:
Manual Testing Needed:
📋 Action ItemsBefore Merge:
Nice to Have: 📝 Additional Notes
Overall Assessment: Good fix for the deprecation warning, but has a critical iOS 12 compatibility issue that must be addressed before merging. Once the version compatibility is resolved, this PR will be ready to merge. |
|
@gemini-cli /review kk |
Summary
Fixed the iOS 13.0 deprecation warning for
keyWindowas described in issue #6.Changes
keyRootViewControllerpropertykeyWindowcalls withkeyRootViewControllerat lines 463 and 467Closes #6
Generated with Claude Code