SecureField

public struct SecureField : View

A view into which the user securely enters private text.

  • Declaration

    Swift

    public var viewStore: ViewValues
  • Declaration

    Swift

    public var body: View { get }
  • Creates an instance with a a value of type String.

    Declaration

    Swift

    public init(_ title: String, text: Binding<String>, onCommit: @escaping () -> Void = {})

    Parameters

    title

    The title of self, used as a placeholder.

    text

    The text to be displayed and edited.

    onCommit

    The action to perform when the user performs an action (usually the return key) while the SecureField has focus.

  • Sets if this view is the first responder or not.

    Setting a value of true will make this view become the first responder if not already. Setting a value of false will make this view resign beign first responder if it is the first responder.

    Important

    Not SwiftUI compatible.

    Declaration

    Swift

    public func firstResponder(_ firstResponder: Binding<Bool>) -> SecureField