another.im-ios/ConversationsClassic/View/UIToolkit/View+If.swift
2024-07-04 17:01:30 +02:00

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
}
}
}