mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
20 lines
410 B
Swift
20 lines
410 B
Swift
|
//
|
||
|
// ViewModifiers.swift
|
||
|
// SimpleX (iOS)
|
||
|
//
|
||
|
// Created by Avently on 12.06.2024.
|
||
|
// Copyright © 2024 SimpleX Chat. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import SwiftUI
|
||
|
|
||
|
extension View {
|
||
|
@ViewBuilder func `if`<Content: View>(_ condition: @autoclosure () -> Bool, transform: (Self) -> Content) -> some View {
|
||
|
if condition() {
|
||
|
transform(self)
|
||
|
} else {
|
||
|
self
|
||
|
}
|
||
|
}
|
||
|
}
|