I have an iOS app with a UITextField that allows the user to enter a number in. How can I ensure that the value the user types in is a valid number (either whole or decimal). Here is what I have tried, but for some reason it won't work for decimal numbers: that allow