Welcome to a fun and easy introduction to app development with SwiftUI! This tutorial will…
SecureField – SwiftUI
SecureField in SwiftUI – a control which allows the user to enter private text securely.
It is similar to TextField, but in SecureField all the characters entered by the user are masked for privacy.
Here is the example of using SecureField in your SwiftUI App
SecureField Example
@State private var password: String = ""
var body: some View {
VStack {
SecureField("Password", text: $password)
.padding(.all, 20)
.multilineTextAlignment(.center)
Text("Result: \(password)")
}
}
Learn more about SwiftUI using SwiftUI Tutorials by the AppMakers
If the code is deprecated or will change in the future, please visit the official SwiftUI Documentation.
Leave a comment to Submit the NEW and USEFUL code related to the topic of this post. Submit a brief and useful code only.