Cкругления glass iOS 26, фикс compiler crash
This commit is contained in:
@@ -421,7 +421,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Rosetta/Rosetta.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Rosetta/Rosetta.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 26;
|
CURRENT_PROJECT_VERSION = 27;
|
||||||
DEVELOPMENT_TEAM = QN8Z263QGX;
|
DEVELOPMENT_TEAM = QN8Z263QGX;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@@ -437,7 +437,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.2.5;
|
MARKETING_VERSION = 1.2.6;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev;
|
PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -460,7 +460,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Rosetta/Rosetta.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Rosetta/Rosetta.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 26;
|
CURRENT_PROJECT_VERSION = 27;
|
||||||
DEVELOPMENT_TEAM = QN8Z263QGX;
|
DEVELOPMENT_TEAM = QN8Z263QGX;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@@ -476,7 +476,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.2.5;
|
MARKETING_VERSION = 1.2.6;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev;
|
PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -530,7 +530,7 @@
|
|||||||
853F296C2F4B50420092AD05 /* Release */,
|
853F296C2F4B50420092AD05 /* Release */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Debug;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
853F296D2F4B50420092AD05 /* Build configuration list for PBXNativeTarget "Rosetta" */ = {
|
853F296D2F4B50420092AD05 /* Build configuration list for PBXNativeTarget "Rosetta" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
@@ -539,7 +539,7 @@
|
|||||||
853F296F2F4B50420092AD05 /* Release */,
|
853F296F2F4B50420092AD05 /* Release */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Debug;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
B5D2E60ADEB8AE2E8F7615C6 /* Build configuration list for PBXNativeTarget "RosettaNotificationService" */ = {
|
B5D2E60ADEB8AE2E8F7615C6 /* Build configuration list for PBXNativeTarget "RosettaNotificationService" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
@@ -548,7 +548,7 @@
|
|||||||
0140D6320A9CF4B5E933E0B1 /* Debug */,
|
0140D6320A9CF4B5E933E0B1 /* Debug */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Debug;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
shouldAutocreateTestPlan = "YES">
|
shouldAutocreateTestPlan = "YES">
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Release"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
|
|||||||
@@ -103,6 +103,13 @@ final class _KeyboardSyncedVC<Content: View, Composer: View>: UIViewController,
|
|||||||
@available(*, unavailable)
|
@available(*, unavailable)
|
||||||
required init?(coder: NSCoder) { fatalError() }
|
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() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
view.backgroundColor = .clear
|
view.backgroundColor = .clear
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ final class TelegramGlassUIView: UIView {
|
|||||||
|
|
||||||
// iOS 26+ native glass
|
// iOS 26+ native glass
|
||||||
private var nativeGlassView: UIVisualEffectView?
|
private var nativeGlassView: UIVisualEffectView?
|
||||||
private var glassMaskLayer: CAShapeLayer?
|
|
||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
@@ -139,6 +138,8 @@ final class TelegramGlassUIView: UIView {
|
|||||||
let glassView = UIVisualEffectView(effect: effect)
|
let glassView = UIVisualEffectView(effect: effect)
|
||||||
glassView.clipsToBounds = true
|
glassView.clipsToBounds = true
|
||||||
glassView.layer.cornerCurve = .continuous
|
glassView.layer.cornerCurve = .continuous
|
||||||
|
// Set initial corner radius — will be updated in layoutSubviews.
|
||||||
|
glassView.layer.cornerRadius = 22
|
||||||
glassView.isUserInteractionEnabled = false
|
glassView.isUserInteractionEnabled = false
|
||||||
addSubview(glassView)
|
addSubview(glassView)
|
||||||
nativeGlassView = glassView
|
nativeGlassView = glassView
|
||||||
@@ -200,18 +201,7 @@ final class TelegramGlassUIView: UIView {
|
|||||||
radius = bounds.height / 2
|
radius = bounds.height / 2
|
||||||
}
|
}
|
||||||
if #available(iOS 26.0, *), let glassView = nativeGlassView {
|
if #available(iOS 26.0, *), let glassView = nativeGlassView {
|
||||||
let mask: CAShapeLayer
|
glassView.layer.cornerRadius = radius
|
||||||
if let existing = glassMaskLayer {
|
|
||||||
mask = existing
|
|
||||||
} else {
|
|
||||||
mask = CAShapeLayer()
|
|
||||||
glassMaskLayer = mask
|
|
||||||
glassView.layer.mask = mask
|
|
||||||
}
|
|
||||||
mask.path = UIBezierPath(
|
|
||||||
roundedRect: bounds,
|
|
||||||
cornerRadius: radius
|
|
||||||
).cgPath
|
|
||||||
} else {
|
} else {
|
||||||
clippingContainer.cornerRadius = radius
|
clippingContainer.cornerRadius = radius
|
||||||
layer.cornerRadius = radius
|
layer.cornerRadius = radius
|
||||||
@@ -235,20 +225,9 @@ final class TelegramGlassUIView: UIView {
|
|||||||
|
|
||||||
if #available(iOS 26.0, *), let glassView = nativeGlassView {
|
if #available(iOS 26.0, *), let glassView = nativeGlassView {
|
||||||
glassView.frame = bounds
|
glassView.frame = bounds
|
||||||
// UIGlassEffect ignores layer.cornerRadius changes after initial layout.
|
// Use cornerRadius directly — simpler and works in current iOS 26 betas.
|
||||||
// Use CAShapeLayer mask — guaranteed to clip the glass to any shape.
|
// CAShapeLayer mask was unreliable with UIGlassEffect in some beta versions.
|
||||||
let mask: CAShapeLayer
|
glassView.layer.cornerRadius = cornerRadius
|
||||||
if let existing = glassMaskLayer {
|
|
||||||
mask = existing
|
|
||||||
} else {
|
|
||||||
mask = CAShapeLayer()
|
|
||||||
glassMaskLayer = mask
|
|
||||||
glassView.layer.mask = mask
|
|
||||||
}
|
|
||||||
mask.path = UIBezierPath(
|
|
||||||
roundedRect: bounds,
|
|
||||||
cornerRadius: cornerRadius
|
|
||||||
).cgPath
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -823,3 +823,4 @@ private struct ClassicSwipeActionsModifier: ViewModifier {
|
|||||||
ChatListView(isSearchActive: .constant(true), isDetailPresented: .constant(false))
|
ChatListView(isSearchActive: .constant(true), isDetailPresented: .constant(false))
|
||||||
.preferredColorScheme(.dark)
|
.preferredColorScheme(.dark)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user