123456789101112131415161718192021222324252627282930313233343536373839 |
- //
- // NSTimer+Addition.m
- // PagedScrollView
- //
- // Created by 陈政 on 14-1-24.
- // Copyright (c) 2014年 Apple Inc. All rights reserved.
- //
- #import "NSTimer+Addition.h"
- @implementation NSTimer (Addition)
- -(void)pauseTimer
- {
- if (![self isValid]) {
- return ;
- }
- [self setFireDate:[NSDate distantFuture]];
- }
- -(void)resumeTimer
- {
- if (![self isValid]) {
- return ;
- }
- [self setFireDate:[NSDate date]];
- }
- - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval
- {
- if (![self isValid]) {
- return ;
- }
- [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
- }
- @end
|