Credit given to Stack Overflow user Jbryson for two methods in UITextField category: Selections.