Open Taehyeon-Kim opened 8 months ago
TextField( "", text: $userInformation.text, prompt: Text(placeholder) .foregroundColor(Color.lightGrey) ) .textFieldStyle(SignUpTextFieldStyle())
struct SignUpTextFieldStyle: TextFieldStyle { func _body(configuration: TextField<Self._Label>) -> some View { configuration .padding() .font(.MC.text) .foregroundStyle(Color.MC.writtenGrey) .background(.white) .overlay { RoundedRectangle(cornerRadius: 4, style: .continuous) .stroke(Color.MC.lightGrey, lineWidth: 1) } } }
https://softwareanders.com/swiftui-textfield-placeholder-best-practices-and-tips/