zoonooz / ZFTokenField

iOS custom view that let you add token view inside like NSTokenField

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can you give an option to disable editing?

sukhrobkhakimov opened this issue · comments

Sometimes, you need to show a list of items, without adding and removing features.

Possible solution:

In ZFTokenField.h file

- (BOOL)tokenFieldShouldBeginEditing:(ZFTokenField *)textField;

In ZFTokenField.m file

- (BOOL)textFieldShouldBeginEditing:(ZFTokenTextField *)textField {
    if ([self.delegate respondsToSelector:@selector(tokenFieldShouldBeginEditing:)]) {
        return [self.delegate tokenFieldShouldBeginEditing:self];
    }

    return YES;
}