Skip to content

Commit 39afd4a

Browse files
committed
Add DynamicLayoutViewExample
1 parent a594001 commit 39afd4a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Example/HostingExample/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ class ViewController: NSViewController {
6666

6767
struct ContentView: View {
6868
var body: some View {
69-
ToggleExample()
69+
DynamicLayoutViewExample()
7070
}
7171
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// DynamicLayoutViewExample.swift
3+
// SharedExample
4+
5+
#if OPENSWIFTUI
6+
import OpenSwiftUI
7+
#else
8+
import SwiftUI
9+
#endif
10+
11+
struct DynamicLayoutViewExample: View {
12+
@State var show = false
13+
var body: some View {
14+
VStack {
15+
Color.red
16+
.task { show = true }
17+
if show {
18+
Color.blue
19+
}
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)