Closed cherpake closed 10 years ago
You should be checking this with the delegate methods, I don't think the field should be responsible.
I do but the sub view us added even if I return NO in willAdd method
-Evgeny
Sent from my iPhone
On 11 בספט 2013, at 23:14, Tom Irving notifications@github.com wrote:
You should be checking this with the delegate methods, I don't think the field should be responsible.
— Reply to this email directly or view it on GitHub.
I'm unable to replicate this behaviour. Returning NO from willAdd stops the token being added.
This could be the same thing as ISSUE #61, actually. I'm gonna close this one to work on that one.
For example add email: a@a.com then space and same email again. When token field will loose focus you will see those 2 emails
I have fixed it with:
(void)addToken:(TIToken *)token {
BOOL shouldAdd = YES; if ([delegate respondsToSelector:@selector(tokenField:willAddToken:)]){ shouldAdd = [delegate tokenField:self willAddToken:token]; }
if (shouldAdd){
} }
and adding this to TIToken
(BOOL)isEqual:(id)object { if ( [object isKindOfClass:[self class]] == NO ) return NO;
TIToken* t = (TIToken*)object; return [t.title isEqualToString:self.title]; }