ZHGCDDispatcher
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
This library requires iOS 8.0+
and Xcode 8.0+
.
Installation
ZHGCDDispatcher is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ZHGCDDispatcher'
Usage
for (int i = 0; i < 100; i++) {
switch ((i%5)) {
case 0: {
ZHAsyncWithQOSUserInteractive(^{
NSLog(@"task %d: %@", i, [NSThread currentThread]);
});
}
break;
case 1: {
ZHAsyncWithQOSUserInitiated(^{
NSLog(@"task %d: %@", i, [NSThread currentThread]);
});
}
break;
case 2: {
ZHAsyncWithQOSUtility(^{
NSLog(@"task %d: %@", i, [NSThread currentThread]);
});
}
break;
case 3: {
ZHAsyncWithQOSBackgroud(^{
NSLog(@"task %d: %@", i, [NSThread currentThread]);
});
}
break;
case 4: {
ZHAsyncWithQOSDefault(^{
NSLog(@"task %d: %@", i, [NSThread currentThread]);
});
}
break;
}
}
Author
xiongzenghui, [email protected]
License
ZHGCDDispatcher is available under the MIT license. See the LICENSE file for more info.