I check out this answer, helpful, but didn't get what I want: Getting and Setting Cursor Position of UITextField and UITextView in Swift.
In the attribute inspector, I set Placeholder to " ____ First Name", and it fixes the left alignment of the text since it is moved to the right a bit. But I don't think that is the proper way to do it. Also, I didn't quite get the cursor position explanation from the above answer.
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool
{
let arbitraryValue: Int = 5
if let newPosition = textView.position(from: textView.beginningOfDocument, offset: arbitraryValue) {
textView.selectedTextRange = textView.textRange(from: newPosition, to: newPosition)
// ....
}
}
The thing is even after somehow I figured it out to make it work, the cursor is moved 5 characters to right. When I removed the text, the cursor moves back into the left corner.
But what I exactly want is the whole textField to move to the right so that it doesn't get covered with CornerRadius like above.