To create a field where you can enter secure text you can use SecureField($password)
https://developer.apple.com/documentation/swiftui/securefield
If you want to set the contentType
of an textField to eg. .oneTimeCode
you can do it like this. Also works with keyboardType
TextField($code)
.textContentType(.oneTimeCode)
.keyboardType(.numberPad)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…