Skip to content

Commit 9bd3571

Browse files
committed
Add TestApp
1 parent 6bb8b65 commit 9bd3571

File tree

1 file changed

+46
-0
lines changed
  • Sources/OpenSwiftUI/AppStructure/AppOrganization/internal

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// TestApp.swift
3+
// OpenSwiftUI
4+
//
5+
// Created by Kyle on 2024/1/9.
6+
// Lastest Version: iOS 15.5
7+
// Status: WIP
8+
// ID: A519B5B95CA8FF4E3445832668F0B2D2
9+
10+
public struct _TestApp {
11+
public init() {
12+
fatalError("TODO")
13+
}
14+
public func run() -> Never {
15+
fatalError("TODO")
16+
}
17+
}
18+
19+
extension _TestApp {
20+
struct RootView: View {
21+
@State
22+
var state: StateType
23+
24+
init() {
25+
fatalError("TODO")
26+
}
27+
28+
var body: some View {
29+
state.testView
30+
fatalError("TODO")
31+
}
32+
}
33+
34+
}
35+
36+
extension _TestApp.RootView {
37+
struct StateType {
38+
var id: Int
39+
var testView: AnyView
40+
41+
mutating func setTestView<V: View>(_ view: V) {
42+
id += 1
43+
testView = AnyView(view.testID(id))
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)