IceCubesApp/Packages/DesignSystem/Sources/DesignSystem/ConditionalModifier.swift
2024-01-23 08:51:58 +01:00

12 lines
249 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
}
}
}