From 872cdb88b0499062fcf951c553fdf36ee3a5646e Mon Sep 17 00:00:00 2001 From: senseiGai Date: Wed, 25 Mar 2026 17:14:22 +0500 Subject: [PATCH] =?UTF-8?q?C=D0=BA=D1=80=D1=83=D0=B3=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20glass=20iOS=2026,=20=D1=84=D0=B8=D0=BA=D1=81=20c?= =?UTF-8?q?ompiler=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rosetta.xcodeproj/project.pbxproj | 14 ++++---- .../xcshareddata/xcschemes/Rosetta.xcscheme | 2 +- .../Components/KeyboardSyncedContainer.swift | 7 ++++ .../Components/TelegramGlassView.swift | 33 ++++--------------- .../Chats/ChatList/ChatListView.swift | 1 + 5 files changed, 22 insertions(+), 35 deletions(-) diff --git a/Rosetta.xcodeproj/project.pbxproj b/Rosetta.xcodeproj/project.pbxproj index 3eb5f73..7192571 100644 --- a/Rosetta.xcodeproj/project.pbxproj +++ b/Rosetta.xcodeproj/project.pbxproj @@ -421,7 +421,7 @@ CODE_SIGN_ENTITLEMENTS = Rosetta/Rosetta.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_TEAM = QN8Z263QGX; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -437,7 +437,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.5; + MARKETING_VERSION = 1.2.6; PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -460,7 +460,7 @@ CODE_SIGN_ENTITLEMENTS = Rosetta/Rosetta.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 26; + CURRENT_PROJECT_VERSION = 27; DEVELOPMENT_TEAM = QN8Z263QGX; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -476,7 +476,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.5; + MARKETING_VERSION = 1.2.6; PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -530,7 +530,7 @@ 853F296C2F4B50420092AD05 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; 853F296D2F4B50420092AD05 /* Build configuration list for PBXNativeTarget "Rosetta" */ = { isa = XCConfigurationList; @@ -539,7 +539,7 @@ 853F296F2F4B50420092AD05 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; B5D2E60ADEB8AE2E8F7615C6 /* Build configuration list for PBXNativeTarget "RosettaNotificationService" */ = { isa = XCConfigurationList; @@ -548,7 +548,7 @@ 0140D6320A9CF4B5E933E0B1 /* Debug */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ diff --git a/Rosetta.xcodeproj/xcshareddata/xcschemes/Rosetta.xcscheme b/Rosetta.xcodeproj/xcshareddata/xcschemes/Rosetta.xcscheme index 104d1d6..d26f870 100644 --- a/Rosetta.xcodeproj/xcshareddata/xcschemes/Rosetta.xcscheme +++ b/Rosetta.xcodeproj/xcshareddata/xcschemes/Rosetta.xcscheme @@ -31,7 +31,7 @@ shouldAutocreateTestPlan = "YES"> : UIViewController, @available(*, unavailable) required init?(coder: NSCoder) { fatalError() } + deinit { + // Explicit deinit — workaround for Swift compiler crash in Release + // optimization (SILFunctionTransform "EarlyPerfInliner" on deinit). + onComposerHeightChange = nil + onTopSafeAreaChange = nil + } + override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear diff --git a/Rosetta/DesignSystem/Components/TelegramGlassView.swift b/Rosetta/DesignSystem/Components/TelegramGlassView.swift index 3e2fcc3..999c3c5 100644 --- a/Rosetta/DesignSystem/Components/TelegramGlassView.swift +++ b/Rosetta/DesignSystem/Components/TelegramGlassView.swift @@ -108,7 +108,6 @@ final class TelegramGlassUIView: UIView { // iOS 26+ native glass private var nativeGlassView: UIVisualEffectView? - private var glassMaskLayer: CAShapeLayer? override init(frame: CGRect) { super.init(frame: frame) @@ -139,6 +138,8 @@ final class TelegramGlassUIView: UIView { let glassView = UIVisualEffectView(effect: effect) glassView.clipsToBounds = true glassView.layer.cornerCurve = .continuous + // Set initial corner radius — will be updated in layoutSubviews. + glassView.layer.cornerRadius = 22 glassView.isUserInteractionEnabled = false addSubview(glassView) nativeGlassView = glassView @@ -200,18 +201,7 @@ final class TelegramGlassUIView: UIView { radius = bounds.height / 2 } if #available(iOS 26.0, *), let glassView = nativeGlassView { - let mask: CAShapeLayer - if let existing = glassMaskLayer { - mask = existing - } else { - mask = CAShapeLayer() - glassMaskLayer = mask - glassView.layer.mask = mask - } - mask.path = UIBezierPath( - roundedRect: bounds, - cornerRadius: radius - ).cgPath + glassView.layer.cornerRadius = radius } else { clippingContainer.cornerRadius = radius layer.cornerRadius = radius @@ -235,20 +225,9 @@ final class TelegramGlassUIView: UIView { if #available(iOS 26.0, *), let glassView = nativeGlassView { glassView.frame = bounds - // UIGlassEffect ignores layer.cornerRadius changes after initial layout. - // Use CAShapeLayer mask — guaranteed to clip the glass to any shape. - let mask: CAShapeLayer - if let existing = glassMaskLayer { - mask = existing - } else { - mask = CAShapeLayer() - glassMaskLayer = mask - glassView.layer.mask = mask - } - mask.path = UIBezierPath( - roundedRect: bounds, - cornerRadius: cornerRadius - ).cgPath + // Use cornerRadius directly — simpler and works in current iOS 26 betas. + // CAShapeLayer mask was unreliable with UIGlassEffect in some beta versions. + glassView.layer.cornerRadius = cornerRadius return } diff --git a/Rosetta/Features/Chats/ChatList/ChatListView.swift b/Rosetta/Features/Chats/ChatList/ChatListView.swift index 9c95300..4507b47 100644 --- a/Rosetta/Features/Chats/ChatList/ChatListView.swift +++ b/Rosetta/Features/Chats/ChatList/ChatListView.swift @@ -823,3 +823,4 @@ private struct ClassicSwipeActionsModifier: ViewModifier { ChatListView(isSearchActive: .constant(true), isDetailPresented: .constant(false)) .preferredColorScheme(.dark) } +