jdg/MBProgressHUD — pull request #108 by idpaterson (2012-11-28 22:44:49+00:00)
Title: Cancel delayed hide and show requests when showing and hiding

There was previously no way to cancel the timers and delayed invocations established by `graceTime`, `minShowTime`, and `hide:afterDelay:`. This was problematic when showing a number of HUD messages in series, as the `minShowTime` of the first message determined when the HUD would be hidden. The expected behavior, as I see it, would be to reset the effects of `minShowTime` each time a show method is called.

I applied the same logic to `hide:afterDelay:` and `graceTime`. The case for `graceTime` is a bit more obscure as you would have to show a message with a `graceTime`, show another message without a `graceTime`, then hide the HUD before the `graceTime` has elapsed. In this scenario, the HUD would pop up again after the timer elapsed.

`[self.graceTimer invalidate];` was chosen over a more verbose option simply because it will be a no-op when `graceTimer` is nil and has less overhead from method calls than the following:
```obj-c
if (self.graceTimer) {
[self.graceTimer invalidate];
self.graceTimer = nil;
}
```

One regression issue is that this would have previously worked:
```obj-c
[hud hide:YES afterDelay:3.0];
[hud show:YES];
```
while now the hide calls must follow the show calls:
```obj-c
[hud show:YES];
[hud hide:YES afterDelay:3.0];
```

This is an alternative to #106 which seemed to be addressing a similar issue.