I have modified the example you want to use as per your need, you can check it out
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if(textField==self.testTextField&&range.location==0)
{
if ([string hasPrefix:@"1"])
{
return NO;
}
}
return YES;
}