• Stars
    star
    188
  • Rank 205,563 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NSTimer like tool implemented using GCD.

JX_GCDTimerManager

JX_GCDTimerManager is a NSTimer like tool implemented using GCD.

Usage

  1. Add the source files JX_GCDTimerManager.h and JX_GCDTimerManager.m to your Xcode project.
  2. Import JX_GCDTimerManager.h .
  3. Use in you code.
__weak typeof(self) weakSelf = self;
[[JX_GCDTimerManager sharedInstance] scheduledDispatchTimerWithName:@"myTime_hash"
                                                       timeInterval:2.0
                                                              queue:dispatch_get_main_queue()
                                                            repeats:NO
                                                      fireInstantly:NO
                                                             action:^{
                                                                 [weakSelf doSomething];
                                                             }];

You can add or remove functions as you need.

Requirements

This component requires iOS 8.0+.

Notice

If you are using JX_GCDTimerManager as a singleton, you should watch out that timer with the same name could interfere each other, as the name is the unique key of the timer. Make sure to use unique names for timer instances.

License

JX_GCDTimerManager is provided under the MIT license. See LICENSE file for details.