iOS textView Issues swift
Problem:
When try to use shouldChangeTextIn textView delegate method for text entering character count you will use the below code.
textView.text = textView.text+string
then if you enter the characters contineously it works well.If you remove front string or interstring then last typed charater is to be placed in last only.So use the below code.
When try to use shouldChangeTextIn textView delegate method for text entering character count you will use the below code.
textView.text = textView.text+string
then if you enter the characters contineously it works well.If you remove front string or interstring then last typed charater is to be placed in last only.So use the below code.
textView.text = (textView.text as! NSString).replacingCharacters(in: range, with: text)
Comments
Post a Comment