@@ -17,15 +17,15 @@ public extension View {
17
17
isPresented: Binding < Bool > ,
18
18
duration nanoseconds: UInt64 = 350_000_000 ,
19
19
animation: Animation = . spring( duration: 0.3 , bounce: 0.25 , blendDuration: 0.1 ) ,
20
- @ViewBuilder popup : @escaping ( _ isPresented: Bool ) -> Popup ,
21
- @ViewBuilder background : @escaping ( _ isPresented: Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) }
20
+ @ViewBuilder background : @escaping ( _ isPresented: Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) } ,
21
+ @ViewBuilder content : @escaping ( _ isPresented: Bool ) -> Popup
22
22
) -> some View {
23
23
modifier (
24
24
PopupModifier (
25
25
isPresented: isPresented,
26
26
duration: nanoseconds,
27
27
animation: animation,
28
- popup: popup ,
28
+ popup: content ,
29
29
background: background
30
30
)
31
31
)
@@ -47,15 +47,15 @@ public extension View {
47
47
isPresented: Binding < Bool > ,
48
48
duration nanoseconds: UInt64 = 350_000_000 ,
49
49
animation: Animation = . spring( duration: 0.3 , bounce: 0.25 , blendDuration: 0.1 ) ,
50
- @ViewBuilder popup : @escaping ( ) -> Popup ,
51
- @ViewBuilder background : @escaping ( _ isPresented : Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) }
50
+ @ViewBuilder background : @escaping ( _ isPresented : Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) } ,
51
+ @ViewBuilder content : @escaping ( ) -> Popup
52
52
) -> some View {
53
53
modifier (
54
54
PopupModifier (
55
55
isPresented: isPresented,
56
56
duration: nanoseconds,
57
57
animation: animation,
58
- popup: { _ in popup ( ) } ,
58
+ popup: { _ in content ( ) } ,
59
59
background: background
60
60
)
61
61
)
@@ -79,15 +79,15 @@ public extension View {
79
79
isPresented: Binding < Bool > ,
80
80
duration: Duration = . seconds( 0.35 ) ,
81
81
animation: Animation = . spring( duration: 0.3 , bounce: 0.25 , blendDuration: 0.1 ) ,
82
- @ViewBuilder popup : @escaping ( _ isPresented: Bool ) -> Popup ,
83
- @ViewBuilder background : @escaping ( _ isPresented: Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) }
82
+ @ViewBuilder background : @escaping ( _ isPresented: Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) } ,
83
+ @ViewBuilder content : @escaping ( _ isPresented: Bool ) -> Popup
84
84
) -> some View {
85
85
modifier (
86
86
PopupModifier (
87
87
isPresented: isPresented,
88
88
duration: duration. nanoseconds,
89
89
animation: animation,
90
- popup: popup ,
90
+ popup: content ,
91
91
background: background
92
92
)
93
93
)
@@ -111,15 +111,15 @@ public extension View {
111
111
isPresented: Binding < Bool > ,
112
112
duration: Duration = . seconds( 0.35 ) ,
113
113
animation: Animation = . spring( duration: 0.3 , bounce: 0.25 , blendDuration: 0.1 ) ,
114
- @ViewBuilder popup : @escaping ( ) -> Popup ,
115
- @ViewBuilder background : @escaping ( _ isPresented : Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) }
114
+ @ViewBuilder background : @escaping ( _ isPresented : Bool ) -> Background = { Color . black . opacity ( $0 ? 0.5 : 0 ) } ,
115
+ @ViewBuilder content : @escaping ( ) -> Popup
116
116
) -> some View {
117
117
modifier (
118
118
PopupModifier (
119
119
isPresented: isPresented,
120
120
duration: duration. nanoseconds,
121
121
animation: animation,
122
- popup: { _ in popup ( ) } ,
122
+ popup: { _ in content ( ) } ,
123
123
background: background
124
124
)
125
125
)
0 commit comments