Skip to content

Formatting while editing phone number #16

Open
@k06a

Description

@k06a

I am trying to achieve UITextField with formatted phone number while user input progress.
My algo:

  1. Get only digits from phone field
  2. Format digits as phone number
  3. Set UITextFields text property new formatted phone number

All works fine, until user tries to edit phone number in the middle.
I can not properly save and restore selectedRange because of formatting chars " -()"

Is there any solution for this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions