Skip to content

Commit b72822e

Browse files
committed
wip
1 parent 7e2102d commit b72822e

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

Sources/ViewTypes/TextFieldWithVerticalAxis.swift

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
import SwiftUI
22

3-
// MARK: SwiftUI.TextField(..., axis: .vertical)
4-
3+
/// An abstract representation of the `TextField` type in SwiftUI, with `.vertical` style.
4+
///
5+
/// ```swift
6+
/// struct ContentView: View {
7+
/// @State var text = "Lorem ipsum"
8+
///
9+
/// var body: some View {
10+
/// TextField("Text Field", text: $text, axis: .vertical)
11+
/// #if os(iOS)
12+
/// .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17)) {
13+
/// print(type(of: $0)) // UITextView
14+
/// }
15+
/// #elseif os(tvOS)
16+
/// .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17)) {
17+
/// print(type(of: $0)) // UITextField
18+
/// }
19+
/// #elseif os(macOS)
20+
/// .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14)) {
21+
/// print(type(of: $0)) // NSTextField
22+
/// }
23+
/// #endif
24+
/// }
25+
/// }
26+
/// ```
527
public struct TextFieldWithVerticalAxisType: IntrospectableViewType {
628
public enum Axis {
729
case vertical

0 commit comments

Comments
 (0)