fmodf
b3b3b3aef7
Reviewed-on: narayana/conversations-classic-ios#1 Co-authored-by: fmodf <fmodf.ios@gmail.com> Co-committed-by: fmodf <fmodf.ios@gmail.com>
12 lines
270 B
Swift
12 lines
270 B
Swift
import SwiftUI
|
|
|
|
public extension View {
|
|
@ViewBuilder func `if`<Content: View>(_ condition: @autoclosure () -> Bool, transform: (Self) -> Content) -> some View {
|
|
if condition() {
|
|
transform(self)
|
|
} else {
|
|
self
|
|
}
|
|
}
|
|
}
|