Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
macguru committed Oct 11, 2013
2 parents cdc0457 + 688b6ac commit 4f0600b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TextKitDemo/Highlighting/TKDHighlightingTextStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ - (void)setAttributes:(NSDictionary *)attrs range:(NSRange)range

- (void)processEditing
{
[super processEditing];


// Regular expression matching all iWords -- first character i, followed by an uppercase alphabetic character, followed by at least one other character. Matches words like iPod, iPhone, etc.
static NSRegularExpression *iExpression;
iExpression = iExpression ?: [NSRegularExpression regularExpressionWithPattern:@"i[\\p{Alphabetic}&&\\p{Uppercase}][\\p{Alphabetic}]+" options:0 error:NULL];
Expand All @@ -75,6 +72,9 @@ - (void)processEditing
// Add red highlight color
[self addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:result.range];
}];

// Call super *after* changing the attrbutes, as it finalizes the attributes and calls the delegate methods.
[super processEditing];
}

@end

0 comments on commit 4f0600b

Please sign in to comment.