djh-/MGWUTimedResourceManager — pull request #1 by zbarryte (2014-08-05 22:32:44+00:00)
Title: optional conditional

I've added a public static getOrCreate method that allows passing in an optional parameter, condition, that must return true in order for that resource to update.

Internally, this is accessed using a private method shouldResourceIncrementForKey:(NSString *)key in MGWUTimedResourceManager. I wasn't sure where to place this, so, for now, I've called it to return INT_MAX instead of returning a remaining time for resources that do not follow the condition.

n.b. The implementation involves runtime object definition, I've attempted to name them in such a way that it won't generate names that ruin anyone's existing files (of the form $$key$$, because probably no one will name a class that way, we could also use ints as the first character, since no one can name their classes that way)