Currency mask

I need to create a currency mask. I did command lines and it works fine, but when I set the value to the textbox an endless loop happened. I control the textbox with Edit Changed Behavior to catch every character the user has set, but when I try to change the text value, an infinity loop happens. :(

Anyone have some simple code?

0


a source to share


1 answer


Are you setting text to textFieldDidChange? Because if you do that, the textFieldDidChange notification will light up again and the text will be set again and the notification will fire again and so on ...



I tried to do this too. The only solution I could think of would be to format the text when the user leaves the textbox. I didn't find a way to reliably format the content of the textbox while the user was editing it.

0


a source







All Articles