mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2025-12-25 12:14:17 +01:00
13 lines
232 B
Swift
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
|
|
}
|
|
}
|
|
}
|