Skip to content

Commit

Permalink
Use newString when computing enteredString.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj Baid committed May 14, 2015
1 parent f367de3 commit 73df463
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion VENTokenField/VENTokenField.m
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRang
for (NSString *delimiter in self.delimiters) {
if (newString.length > delimiter.length &&
[[newString substringFromIndex:newString.length - delimiter.length] isEqualToString:delimiter]) {
NSString *enteredString = [textField.text substringToIndex:newString.length - delimiter.length];
NSString *enteredString = [newString substringToIndex:newString.length - delimiter.length];
if ([self.delegate respondsToSelector:@selector(tokenField:didEnterText:)]) {
if (enteredString.length) {
[self.delegate tokenField:self didEnterText:enteredString];
Expand Down

0 comments on commit 73df463

Please sign in to comment.