We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e005014 commit 9941ab8Copy full SHA for 9941ab8
Sources/SwiftUIExtension/Extensions/ViewExtension.swift
@@ -1,5 +1,16 @@
1
import SwiftUI
2
3
+extension View {
4
+
5
+ @ViewBuilder func `if`<Content: View>(_ condition: Bool, transform: (Self) -> Content) -> some View {
6
+ if condition {
7
+ transform(self)
8
+ } else {
9
+ self
10
+ }
11
12
+}
13
14
extension View {
15
16
public func onReceive(notification name: Notification.Name, perform action: @escaping (NotificationCenter.Publisher.Output) -> Void) -> some View {
0 commit comments