Skip to content

Commit 27ac014

Browse files
committed
wip
1 parent 523cc85 commit 27ac014

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

Sources/ViewTypes/TextFieldWithVerticalAxis.swift

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,51 @@ import SwiftUI
22

33
/// An abstract representation of the `TextField` type in SwiftUI, with `.vertical` axis.
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, axis: .vertical)
11-
/// #if os(iOS)
1213
/// .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17)) {
1314
/// print(type(of: $0)) // UITextView
1415
/// }
15-
/// #elseif os(tvOS)
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, axis: .vertical)
1628
/// .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17)) {
1729
/// print(type(of: $0)) // UITextField
1830
/// }
19-
/// #elseif os(macOS)
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, axis: .vertical)
2043
/// .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14)) {
2144
/// print(type(of: $0)) // NSTextField
2245
/// }
23-
/// #endif
2446
/// }
2547
/// }
2648
/// ```
49+
///
2750
public struct TextFieldWithVerticalAxisType: IntrospectableViewType {
2851
public enum Axis {
2952
case vertical

0 commit comments

Comments
 (0)