Latest | 0.1.6 |
---|---|
Homepage | https://github.com/cnkcq/GlobalTimer |
License | MIT |
Platforms | ios 8.0 |
Authors |
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
- Xcode
- Objective-C
Features
- [x] start a loop with an event.
- [x] pause a specific loop.
- [x] active a specific loop.
- [x] remove a specific loop.
- [x] 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;
:book: 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
Author
[email protected], [email protected]
License
GlobalTimer is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "GlobalTimer", "version": "0.1.6", "summary": "A short description of GlobalTimer.", "description": "TODO: Add long description of the pod here.", "homepage": "https://github.com/cnkcq/GlobalTimer", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "[email protected]": "[email protected]" }, "source": { "git": "https://github.com/cnkcq/GlobalTimer.git", "tag": "0.1.6" }, "platforms": { "ios": "8.0" }, "source_files": "GlobalTimer/Classes/**/*" }
Fri, 03 Aug 2018 12:20:51 +0000