🐞mismatching types

╱🚧 under construction

SwiftUIviewmodifierrendering.clipShape🐞 mismatching types

Text("Clipped text in a circle")
    .frame(width: 50, height: 50)
    // 🐞 mismatching types
    .clipShape(isOn ? Circle() : Capsule())

👉 解決方案: AnyShape, 用 enum 封裝不同型別, has non-Sendable type

Last updated

Was this helpful?