ResponsiveTextField Documentation

Structure Responsive​Text​Field

public struct ResponsiveTextField  

A SwiftUI wrapper around UITextField that gives precise control over the responder state.

%3 ResponsiveTextField ResponsiveTextField UIViewRepresentable UIViewRepresentable ResponsiveTextField->UIViewRepresentable

Nested Types

ResponsiveTextField.Coordinator
ResponsiveTextField.Configuration

Provides a way of configuring the underlying UITextField inside a ResponsiveTextField.

Conforms To

UIViewRepresentable

Initializers

init(placeholder:​text:​is​Secure:​adjusts​Font​For​Content​Size​Category:​first​Responder​Demand:​configuration:​on​First​Responder​State​Changed:​handle​Return:​handle​Delete:​should​Change:​supported​Standard​Edit​Actions:​standard​Edit​Action​Handler:​)

public init(
        placeholder: String,
        text: Binding<String>,
        isSecure: Bool = false,
        adjustsFontForContentSizeCategory: Bool = true,
        firstResponderDemand: Binding<FirstResponderDemand?>? = nil,
        configuration: Configuration = .empty,
        onFirstResponderStateChanged: FirstResponderStateChangeHandler? = nil,
        handleReturn: (() -> Void)? = nil,
        handleDelete: ((String) -> Void)? = nil,
        shouldChange: ((String, String) -> Bool)? = nil,
        supportedStandardEditActions: Set<StandardEditAction>? = nil,
        standardEditActionHandler: StandardEditActionHandling<UITextField>? = nil
    )  

Methods

make​UIView(context:​)

public func makeUIView(context: Context) -> UITextField  

make​Coordinator()

public func makeCoordinator() -> Coordinator  

update​UIView(_:​context:​)

public func updateUIView(_ uiView: UITextField, context: Context)  

Will update the text view when the containing view triggers a body re-calculation.

If the first responder state has changed, this may trigger the textfield to become or resign first responder.