0

I am very new to coding, therefore sorry if this question is really silly) I am making a program which will get users input through text field, multiply it by 2 and then return user the result. I need to check if user typed in the UItextField a number pr if he/she typed in some text. if it's a text then in a UILabel will appear " sorry, give me a number" if it's a number - program will multiply it and show result in a label.

So, how can I check if the users input in UITextField is numeric? I tried casting it to an Int but obviously I can't do magic outside Hogwarts and it didn't work(

Thank you very much!

0 Answers0