Comma and dot on decimal keyboard

474 Views Asked by At

I have a decimal keyboard and I want to have on it dot and comma . Is it possible by default?

I was trying to add a custom button, but the method addDot it's not called . Any idea why or how can I do this?

 -(void)textFieldDidBeginEditing:(UITextField *)textField{
     if ([self.cowPrice isFirstResponder] ) {
         UIButton *commaButton = [UIButton buttonWithType:UIButtonTypeCustom];
         [commaButton setFrame: CGRectMake(0, 206, 53, 55)];
         [commaButton setTitle:@"," forState:UIControlStateNormal];
         [commaButton addTarget:self action:@selector(addComma) forControlEvents:UIControlEventTouchUpInside];
         [commaButton setBackgroundColor:[UIColor orangeColor]];
         [ self.cowPrice.inputAccessoryView addSubview:commaButton];
         [self.cowPrice.inputAccessoryView bringSubviewToFront:commaButton];
     }
 }

-(void)addComma{
    NSLog(@"yes");
}

enter image description here

0

There are 0 best solutions below