-
Notifications
You must be signed in to change notification settings - Fork 258
Open
Labels
Milestone
Description
Instead of having a separate NSString* format, only expose the formatBlock property, and make a setFormat: method that sets up the right format block only at set time instead of on every iteration.
This will ultimately improve performance, as a single block call each time is much faster than regular expression searches every frame.
So, it would look something like:
-(void)setFormat:(NSString*)format
{
self.formatBlock = ^(NSString*) ^(float val) {
return [NSString stringWithFormat:format,val];
};
}
Note - something will have to deal with formats that pass in %d or %i (as the current regex does) - perhaps find these and then cast to int if it has those? maybe two different blocks? just ideas
Reactions are currently unavailable