How to programmatically select text in a UITextField without "range selectors" on the side

I have a UITextField in my application that is in a UITableView and I want their text to be UITextField when I click on them, because usually users will want to erase what they already have before entering new text. I have successfully done this, but the fact is that when the text is highlighted, these ugly little blue โ€œlollipopsโ€ used to select the range of the selected text appear on the sides of the text. How can I make them not appear? Thanks!

my code (qty and numberOfPeople is a UITextField ):

 -(void)textFieldDidBeginEditing:(UITextField *)textField { for (NSInteger i=0; i<n; i++){ NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0]; CustomCell *cell = (CustomCell *) [self.itemTable cellForRowAtIndexPath:indexPath]; if ([textField isEqual:cell.qty] || [textField isEqual:cell.numberOfPeople]){ [textField selectAll:self]; } } } 
+4
source share

Source: https://habr.com/ru/post/1478984/


All Articles