IceCubesApp/Packages/DesignSystem/Sources/DesignSystem/ConditionalModifier.swift
Thomas Ricouard 1f858414d8 format .
2024-02-14 12:48:14 +01:00

12 lines
221 B
Swift

import SwiftUI
public extension View {
@ViewBuilder func `if`<Content: View>(_ condition: Bool, transform: (Self) -> Content) -> some View {
if condition {
transform(self)
} else {
self
}
}
}