From 9ff421c6c28651d939274acf4f05e64ee1a52c4a Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 29 Apr 2025 04:18:27 +0000 Subject: [PATCH] Fix Swift compilation errors 1. Fixed extraneous closing brace in AppDelegate+PhasedInitialization.swift 2. Fixed indentation in initializeComponentsWithCrashProtection method 3. Removed duplicate applyBlueTintedShadow method from CALayer+Shadow.swift to resolve redeclaration error --- .../AppDelegate+PhasedInitialization.swift | 21 +++++++++---------- iOS/Extensions/CALayer+Shadow.swift | 9 -------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/iOS/Delegates/AppDelegate+PhasedInitialization.swift b/iOS/Delegates/AppDelegate+PhasedInitialization.swift index 2ea8c93..cc5aea7 100644 --- a/iOS/Delegates/AppDelegate+PhasedInitialization.swift +++ b/iOS/Delegates/AppDelegate+PhasedInitialization.swift @@ -120,17 +120,16 @@ extension AppDelegate { // Ensure UI is responsive regardless of initialization state DispatchQueue.main.async { - // Use UIWindowScene.windows on iOS 15+ instead of deprecated UIApplication.shared.windows - if #available(iOS 15.0, *) { - if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, - let rootVC = windowScene.windows.first?.rootViewController { - rootVC.view.isUserInteractionEnabled = true - } - } else { - // Fallback for older iOS versions - if let rootVC = UIApplication.shared.windows.first?.rootViewController { - rootVC.view.isUserInteractionEnabled = true - } + // Use UIWindowScene.windows on iOS 15+ instead of deprecated UIApplication.shared.windows + if #available(iOS 15.0, *) { + if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, + let rootVC = windowScene.windows.first?.rootViewController { + rootVC.view.isUserInteractionEnabled = true + } + } else { + // Fallback for older iOS versions + if let rootVC = UIApplication.shared.windows.first?.rootViewController { + rootVC.view.isUserInteractionEnabled = true } } } diff --git a/iOS/Extensions/CALayer+Shadow.swift b/iOS/Extensions/CALayer+Shadow.swift index 501f6d4..0066348 100644 --- a/iOS/Extensions/CALayer+Shadow.swift +++ b/iOS/Extensions/CALayer+Shadow.swift @@ -1,15 +1,6 @@ import UIKit extension CALayer { - /// Apply a blue tinted shadow effect to the layer - func applyBlueTintedShadow() { - masksToBounds = false - shadowColor = UIColor.systemBlue.cgColor - shadowOffset = CGSize(width: 0, height: 4) - shadowOpacity = 0.2 - shadowRadius = 8 - } - /// Apply a futuristic shadow effect to the layer func applyFuturisticShadow() { masksToBounds = false