Skip to content

Commit b75abe1

Browse files
committed
Update documentation
1 parent d7a2e21 commit b75abe1

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Sources/FloatingPromptTextField/FloatingPromptTextField.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ extension FloatingPromptTextField where Prompt == FloatingPrompt {
112112

113113
@available(iOS 15.0, *)
114114
extension FloatingPromptTextField where TextFieldForegroundStyle == PrimaryContentStyle, Prompt == FloatingPrompt {
115-
/// Creates a FloatingPromptTextField with a string binding and a view that will be used as
116-
/// a prompt
115+
/// Creates a FloatingPromptTextField with a string binding and a view that will be used
116+
/// as the prompt.
117117
///
118118
/// - Parameters:
119119
/// - text: A binding to the text to display and edit.
120120
/// - prompt: A view that will be used as a prompt when the text field
121-
/// is empty, and as a floating label when it's focused or not empty
121+
/// is empty, and as a floating prompt when it's focused or not empty,
122122
public init(text: Binding<String>,
123123
@ViewBuilder prompt: () -> Prompt) {
124124
self.init(text: text,
@@ -130,13 +130,13 @@ extension FloatingPromptTextField where TextFieldForegroundStyle == PrimaryConte
130130

131131
@available(iOS 15.0, *)
132132
extension FloatingPromptTextField where TextFieldForegroundStyle == PrimaryContentStyle, Prompt == Text, FloatingPrompt == Text {
133-
/// Creates a FloatingPromptTextField with a string binding and a view that will be used as
134-
/// a prompt
133+
/// Creates a FloatingPromptTextField with a string binding and a Text view that will be
134+
/// used as the prompt.
135135
///
136136
/// - Parameters:
137137
/// - text: A binding to the text to display and edit.
138138
/// - prompt: A Text view that will be used as a prompt when the text field
139-
/// is empty, and as a floating label when it's focused or not empty
139+
/// is empty, and as a floating prompt when it's focused or not empty.
140140
public init(text: Binding<String>, prompt: Text) {
141141
self.init(text: text,
142142
textFieldStyle: .primary,
@@ -149,17 +149,18 @@ extension FloatingPromptTextField where TextFieldForegroundStyle == PrimaryConte
149149
extension FloatingPromptTextField {
150150
/// Sets the font for the text field in this view.
151151
///
152-
/// - Parameter font: The default font to use in this view.
152+
/// - Parameter font: The font for the text field.
153153
public func font(_ font: Font) -> Self {
154154
var this = self
155155
this.font = font
156156
return this
157157
}
158158

159-
/// Sets the font for the text field in this view.
159+
/// A `View` to be used as the floating prompt when the text field is focused
160+
/// or not empty.
160161
///
161162
/// - Parameter floatingPrompt: The view that will be used as the floating
162-
/// prompt.
163+
/// prompt when the text field is focused or not empty.
163164
public func floatingPrompt<Content: View>(_ floatingPrompt: Content) -> FloatingPromptTextField<Prompt, Content, TextFieldForegroundStyle> {
164165
FloatingPromptTextField<Prompt, Content, TextFieldForegroundStyle>(
165166
text: text,
@@ -206,7 +207,8 @@ extension FloatingPromptTextField {
206207
/// floating prompt, or if the height of the floating prompt will
207208
/// always be calculated into the height's view.
208209
///
209-
/// - Parameter animateHeight: The default font to use in this view.
210+
/// - Parameter animateHeight: Whether or not the view will animate its
211+
/// height to accommodate the floating prompt.
210212
public func animateHeight(_ animateHeight: Bool) -> Self {
211213
var this = self
212214
this.animateHeight = animateHeight

0 commit comments

Comments
 (0)