Closed ghostiam closed 9 years ago
AKTagCell.m
_deleteButton.enabled = selected;
-(void)setSelected:(BOOL)selected
_deleteButton.enabled = NO;
_deleteButton.enabled = YES;
-(UIButton *)deleteButton
AKTagsInputView.m
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ UIAlertView *alertViewChangeTag = [[UIAlertView alloc] init]; [alertViewChangeTag setDelegate:self]; [alertViewChangeTag setTitle:@"Edit tag"]; [alertViewChangeTag addButtonWithTitle:@"Cancel"]; [alertViewChangeTag addButtonWithTitle:@"OK"]; [alertViewChangeTag setAlertViewStyle:UIAlertViewStylePlainTextInput]; AKTagCell* cell = (AKTagCell*)[collectionView cellForItemAtIndexPath:indexPath]; [[alertViewChangeTag textFieldAtIndex:0] setText:cell.tagName]; [[alertViewChangeTag textFieldAtIndex:0] setDelegate:self]; [alertViewChangeTag show]; } - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ NSString *newTag = [[alertView textFieldAtIndex:0] text]; if (buttonIndex == 1 && newTag.length > 0) { NSIndexPath* index = [self.collectionView indexPathsForSelectedItems][0]; [self deleteItemAt:index completion:nil]; [self addNewItemWithString:newTag completion:nil]; } }
Maybe someone deems useful.
Hi, If you'd like to help to improve the original codebase, there are more important issues https://github.com/purrrminator/AKTagsInputView/labels/enhancement
AKTagCell.m
_deleteButton.enabled = selected;
from-(void)setSelected:(BOOL)selected
_deleteButton.enabled = NO;
on_deleteButton.enabled = YES;
from-(UIButton *)deleteButton
AKTagsInputView.m
Maybe someone deems useful.