I want to make a custom text field which will display the amount and (%) symbol can anyone please tell me how can i acheive this. if i enter 12 it should auto insert 12%
in UIKit it will be like textField.text = "(text) %"
struct UiTextFieldRepresentable: UIViewRepresentable {
@Binding var text: String
func makeUIView(context: Context) -> some UIView {
let textField = UITextField(frame: .zero)
textField.placeholder = "Enter your text"
textField.text = "\(text) %"
return textField
}
func updateUIView(_ uiView: UIViewType, context: Context) {
}
}
issue with this code is it is showing % sign before i start writing. all i want want is when i start writing in the field it should postfix the % sign

