Skip to content

Commit 523cc85

Browse files
committed
wip
1 parent cad6114 commit 523cc85

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

Sources/ViewTypes/TextField.swift

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,47 @@ import SwiftUI
22

33
/// An abstract representation of the `TextField` type in SwiftUI.
44
///
5+
/// ### iOS
6+
///
57
/// ```swift
68
/// struct ContentView: View {
79
/// @State var text = "Lorem ipsum"
810
///
911
/// var body: some View {
1012
/// TextField("Text Field", text: $text)
11-
/// #if os(iOS) || os(tvOS)
12-
/// .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17), .tvOS(.v13, .v14, .v15, .v16, .v17)) {
13+
/// .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17)) {
1314
/// print(type(of: $0)) // UITextField
1415
/// }
15-
/// #elseif os(macOS)
16+
/// }
17+
/// }
18+
/// ```
19+
///
20+
/// ### tvOS
21+
///
22+
/// ```swift
23+
/// struct ContentView: View {
24+
/// @State var text = "Lorem ipsum"
25+
///
26+
/// var body: some View {
27+
/// TextField("Text Field", text: $text)
28+
/// .introspect(.textField, on: .tvOS(.v13, .v14, .v15, .v16, .v17)) {
29+
/// print(type(of: $0)) // UITextField
30+
/// }
31+
/// }
32+
/// }
33+
/// ```
34+
///
35+
/// ### macOS
36+
///
37+
/// ```swift
38+
/// struct ContentView: View {
39+
/// @State var text = "Lorem ipsum"
40+
///
41+
/// var body: some View {
42+
/// TextField("Text Field", text: $text)
1643
/// .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14)) {
1744
/// print(type(of: $0)) // NSTextField
1845
/// }
19-
/// #endif
2046
/// }
2147
/// }
2248
/// ```

0 commit comments

Comments
 (0)