Skip to content

Commit

Permalink
Merge pull request #91 from benj-o/main
Browse files Browse the repository at this point in the history
Incorrect comment regarding custom text field styles
  • Loading branch information
a-moss authored Sep 10, 2021
2 parents 28104a5 + 3e8efc8 commit 6f72168
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions SwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44160,16 +44160,22 @@ extension TextField where Label == Text {
/// ``View/textFieldStyle(_:)`` to change the
/// style of ``TextField`` views.
///
/// There are currently only 3 styles available on iOS:
/// There are currently 3 system-provided styles available on iOS:
/// - ``DefaultTextFieldStyle``
/// - ``PlainTextFieldStyle``
/// - ``RoundedBorderTextFieldStyle``
/// - ``SquareBorderTextFieldStyle`` (macOS only)
///
/// There is currently no way to create your own text field styles.
/// The best way to create a custom text field is by placing
/// your ``TextField`` in a ``ZStack``, and styling the elements around it.
///
/// You can create custom text field styles using the `TextFieldStyle` protocol:
/// ```
/// struct MyTextFieldStyle: TextFieldStyle {
/// public func _body(configuration field: TextField<_Label>) -> some View {
/// field.textFieldStyle(PlainTextFieldStyle())
/// // style here
/// }
/// }
/// ```
///
/// ```
/// struct TextFieldView: View {
/// @State private var input = ""
Expand Down

0 comments on commit 6f72168

Please sign in to comment.