Atoll/DynamicIsland/extensions/ConditionalModifier.swift
Hariharan Mudaliar 13a2ff0e20 Working
2025-07-13 22:16:02 +05:30

18 lines
360 B
Swift

//
// ConditionalModifier.swift
// DynamicIsland
//
// Created by Richard Kunkli on 20/08/2024.
//
import SwiftUI
extension View {
@ViewBuilder func conditionalModifier<Content: View>(_ condition: Bool, transform: (Self) -> Content) -> some View {
if condition {
transform(self)
} else {
self
}
}
}