GlobalTimer 0.1.6

GlobalTimer 0.1.6

Maintained by CNKCQ.



GlobalTimer

CI Status Version License Platform

images

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode
  • Objective-C

Features

  • start a loop with an event.
  • pause a specific loop.
  • active a specific loop.
  • remove a specific loop.
  • update a loop with a new interval

Installation

GlobalTimer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'GlobalTimer'

Api

+ (instancetype _Nonnull )shared;

- (void)scheduledWith: (NSString  * _Nonnull )identifirer timeInterval: (NSTimeInterval)interval repeat:(BOOL)repeat block:(GTBlock _Nonnull )block userinfo:(NSDictionary * _Nullable)userinfo;

- (void)updateEventWith: (NSString  * _Nonnull )identifirer timeInterval: (NSTimeInterval)interval repeat:(BOOL)repeat block:(GTBlock _Nonnull )block userinfo:(NSDictionary * _Nullable)userinfo;

- (void)pauseEventWith: (NSString *_Nonnull)identifirer;

- (void)removeEventWith: (NSString *_Nonnull)identifirer;

- (void)activeEventWith:(NSString *_Nonnull)identifirer;

- (NSArray<NSString *> *_Nonnull)eventList;

πŸ“– Usage

    [[GTimer shared] scheduledWith:@"first" timeInterval:2 repeat:YES block:^(NSDictionary *userinfo) {
        NSLog(@"πŸ‡ΊπŸ‡Έ%@", userinfo[@"test"]);
    } userinfo:@{@"test": @"ok"}];
    
    [[GTimer shared] scheduledWith:@"second" timeInterval:5 repeat:YES block:^(NSDictionary *userinfo) {
        NSLog(@"🌺%@", userinfo[@"cnkcq"]);
    } userinfo:@{@"cnkcq": @"king"}];
    [[GTimer shared] scheduledWith:@"dog" timeInterval:5 repeat:YES block:^(NSDictionary *userinfo) {
        NSLog(@"🐢%@", userinfo[@"dog"]);
    } userinfo:@{@"dog": @"ζ—Ίθ΄’"}];
    [[GTimer shared] scheduledWith:@"fourth" timeInterval:10 repeat:YES block:^(NSDictionary *userinfo) {
        NSLog(@"🐱%@", userinfo[@"cat"]);
    } userinfo:@{@"cat": @"ε’ͺε’ͺ"}];
    [[GTimer shared] pauseEventWith:@"dog"];
        NSLog(@"%@", [[GTimer shared] eventList]);
    [[GTimer shared] activeEventWith:@"dog"];
    [[GTimer shared] removeEventWith:@"fourth"];

Reprensent

ti

Author

[email protected], [email protected]

License

GlobalTimer is available under the MIT license. See the LICENSE file for more info.