In Swift, is it possible to set a max INT value to a UITextField?

My use-case is I have 5 text fields that need to have a maximum int value. These values range from 500 all the way to 10,000. Each of the 5 different text fields will have a different max. I can't use a picker or dropdown because the increments will be 1. And a UISlider will be way too tough to "scrub in" on the number.

If the max int value is 5,000, user can not type in (on the keyboard type of number pad) a value any higher than 5000. 

Character count won't work, because if the max value is 500, if I set to 3 characters, user can type in 999.