@@ -16,13 +16,16 @@ struct ContentView: View {
16
16
NavigationShowcase ( )
17
17
. tabItem { Text ( " Navigation " ) }
18
18
. tag ( 2 )
19
+ PresentationShowcase ( )
20
+ . tabItem { Text ( " Presentation " ) }
21
+ . tag ( 3 )
19
22
#endif
20
23
GenericViewShowcase ( )
21
24
. tabItem { Text ( " Generic View " ) }
22
- . tag ( 3 )
25
+ . tag ( 4 )
23
26
SimpleElementsShowcase ( )
24
27
. tabItem { Text ( " Simple elements " ) }
25
- . tag ( 4 )
28
+ . tag ( 5 )
26
29
}
27
30
#if os(iOS) || os(tvOS)
28
31
. introspect( . tabView, on: . iOS( . v13, . v14, . v15, . v16, . v17) , . tvOS( . v13, . v14, . v15, . v16, . v17) ) { tabBarController in
@@ -196,6 +199,30 @@ struct NavigationShowcase: View {
196
199
}
197
200
}
198
201
202
+ struct PresentationShowcase : View {
203
+ @State var isSheetPresented = false
204
+ @State var isFullScreenPresented = false
205
+ @State var isPopoverPresented = false
206
+
207
+ var body : some View {
208
+ if #available( iOS 14 , tvOS 14 , * ) {
209
+ Button ( " Full Screen Cover " , action: { isFullScreenPresented = true } )
210
+ . fullScreenCover ( isPresented: $isFullScreenPresented) {
211
+ Button ( " Dismiss " , action: { isFullScreenPresented = false } )
212
+ #if os(iOS) || os(tvOS)
213
+ . introspect(
214
+ . fullScreenCover,
215
+ on: . iOS( . v14, . v15, . v16, . v17) , . tvOS( . v14, . v15, . v16, . v17)
216
+ ) { presentationController in
217
+ presentationController. containerView? . backgroundColor = . red. withAlphaComponent ( 0.75 )
218
+ presentationController. presentedView? . backgroundColor = . blue
219
+ }
220
+ #endif
221
+ }
222
+ }
223
+ }
224
+ }
225
+
199
226
struct GenericViewShowcase : View {
200
227
var body : some View {
201
228
VStack ( spacing: 10 ) {
0 commit comments