mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
18 lines
358 B
Swift
18 lines
358 B
Swift
//
|
|
// ConditionalModifier.swift
|
|
// boringNotch
|
|
//
|
|
// 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
|
|
}
|
|
}
|
|
}
|