Files
xcodesApp-mirror/Xcodes/Frontend/View+Conditional.swift
2020-12-28 12:42:28 -07:00

13 lines
232 B
Swift

import SwiftUI
extension View {
@ViewBuilder
func `if`<Other: View>(_ predicate: Bool, then: (Self) -> Other) -> some View {
if predicate {
then(self)
} else {
self
}
}
}