blob: 0ec6d7bab38598b289210f33d3a6d2df0553172a (
plain) (
blame)
1
2
3
4
5
6
7
8
|
import SwiftUI
extension View {
@ViewBuilder
func `if`<Transform: View>(_ condition: Bool, transform: (Self) -> Transform) -> some View {
if condition { transform(self) } else { self }
}
}
|