|
1 | 1 | #if !os(watchOS) |
2 | 2 | /// An abstract representation of a generic SwiftUI view type. |
3 | 3 | /// |
| 4 | +/// Note: prior to iOS 26, `Text`, `Image`, and `Button` were drawn inside a subclass of |
| 5 | +/// `UIView` called `_UIGraphicsView` which was introspectable via `.introspect(.view)`, |
| 6 | +/// however starting iOS 26 this is no longer the case and all SwiftUI primitives |
| 7 | +/// seem to somehow be drawn without an underlying `UIView` vessel. |
| 8 | +/// |
4 | 9 | /// ### iOS |
5 | 10 | /// |
6 | 11 | /// ```swift |
7 | 12 | /// struct ContentView: View { |
8 | 13 | /// var body: some View { |
9 | | -/// HStack { |
10 | | -/// Image(systemName: "scribble") |
11 | | -/// Text("Some text") |
12 | | -/// } |
13 | | -/// .introspect(.view, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { |
14 | | -/// print(type(of: $0)) // some subclass of UIView |
15 | | -/// } |
| 14 | +/// ExampleUIViewRepresentable() |
| 15 | +/// .introspect(.view, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { |
| 16 | +/// print(type(of: $0)) // some subclass of UIView |
| 17 | +/// } |
16 | 18 | /// } |
17 | 19 | /// } |
18 | 20 | /// ``` |
|
22 | 24 | /// ```swift |
23 | 25 | /// struct ContentView: View { |
24 | 26 | /// var body: some View { |
25 | | -/// HStack { |
26 | | -/// Image(systemName: "scribble") |
27 | | -/// Text("Some text") |
28 | | -/// } |
29 | | -/// .introspect(.view, on: .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { |
30 | | -/// print(type(of: $0)) // some subclass of UIView |
31 | | -/// } |
| 27 | +/// ExampleUIViewRepresentable() |
| 28 | +/// .introspect(.view, on: .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { |
| 29 | +/// print(type(of: $0)) // some subclass of UIView |
| 30 | +/// } |
32 | 31 | /// } |
33 | 32 | /// } |
34 | 33 | /// ``` |
|
38 | 37 | /// ```swift |
39 | 38 | /// struct ContentView: View { |
40 | 39 | /// var body: some View { |
41 | | -/// HStack { |
42 | | -/// Image(systemName: "scribble") |
43 | | -/// Text("Some text") |
44 | | -/// } |
45 | | -/// .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { |
46 | | -/// print(type(of: $0)) // some subclass of NSView |
47 | | -/// } |
| 40 | +/// ExampleUIViewRepresentable() |
| 41 | +/// .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { |
| 42 | +/// print(type(of: $0)) // some subclass of NSView |
| 43 | +/// } |
48 | 44 | /// } |
49 | 45 | /// } |
50 | 46 | /// ``` |
|
54 | 50 | /// ```swift |
55 | 51 | /// struct ContentView: View { |
56 | 52 | /// var body: some View { |
57 | | -/// HStack { |
58 | | -/// Image(systemName: "scribble") |
59 | | -/// Text("Some text") |
60 | | -/// } |
61 | | -/// .introspect(.view, on: .visionOS(.v1, .v2, .v26)) { |
62 | | -/// print(type(of: $0)) // some subclass of UIView |
63 | | -/// } |
| 53 | +/// ExampleUIViewRepresentable() |
| 54 | +/// .introspect(.view, on: .visionOS(.v1, .v2, .v26)) { |
| 55 | +/// print(type(of: $0)) // some subclass of UIView |
| 56 | +/// } |
64 | 57 | /// } |
65 | 58 | /// } |
66 | 59 | /// ``` |
|
0 commit comments