Fix presentationCornerRadius iOS 16.0 availability
Wrap in a ViewModifier that guards with #available(iOS 16.4, *), keeping the rounded sheet on 16.4+ while compiling clean on 16.0+. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,7 @@ struct LoginView: View {
|
|||||||
navigateToDashboard = true
|
navigateToDashboard = true
|
||||||
}
|
}
|
||||||
.presentationDetents([.height(200)])
|
.presentationDetents([.height(200)])
|
||||||
.presentationCornerRadius(20)
|
.modifier(SheetCornerRadius(20))
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
vm.onAuthenticated = { navigateToDashboard = true }
|
vm.onAuthenticated = { navigateToDashboard = true }
|
||||||
@@ -158,3 +158,15 @@ struct MoreOptionsSheet: View {
|
|||||||
.buttonStyle(ScaleButtonStyle())
|
.buttonStyle(ScaleButtonStyle())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private struct SheetCornerRadius: ViewModifier {
|
||||||
|
let radius: CGFloat
|
||||||
|
init(_ radius: CGFloat) { self.radius = radius }
|
||||||
|
func body(content: Content) -> some View {
|
||||||
|
if #available(iOS 16.4, *) {
|
||||||
|
content.presentationCornerRadius(radius)
|
||||||
|
} else {
|
||||||
|
content
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user