24 lines
724 B
Swift
24 lines
724 B
Swift
|
|
import SwiftUI
|
||
|
|
|
||
|
|
public extension View {
|
||
|
|
@ViewBuilder
|
||
|
|
func sioGlassChrome() -> some View {
|
||
|
|
if #available(iOS 26.0, macOS 26.0, *) {
|
||
|
|
self.glassEffect(.regular)
|
||
|
|
} else {
|
||
|
|
self.background(.regularMaterial)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
@ViewBuilder
|
||
|
|
func sioGlassSurface<S: Shape>(in shape: S, tint: Color? = nil) -> some View {
|
||
|
|
if #available(iOS 26.0, macOS 26.0, *) {
|
||
|
|
self.glassEffect(Glass.regular.tint(tint), in: shape)
|
||
|
|
} else {
|
||
|
|
self.background(.regularMaterial, in: shape)
|
||
|
|
.overlay(shape.stroke(Color.primary.opacity(0.08), lineWidth: 1))
|
||
|
|
.overlay(shape.fill((tint ?? .clear).opacity(0.08)))
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|