8000 GitHub - nzrsky/ODDispatch: Header-only GCD/DispatchQueue syntax sugar for ObjC 🚦
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

nzrsky/ODDispatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ODDispatch

Build Status codecov.io CocoaPods Compatible Carthage compatible Platform Twitter

Usage

ODDispatchOnce

@import ODDispatch;

// Before 
static id singletone;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^(){
 	singletone = [Singletone new];
});

// After
static id singletone;
ODDispatchOnce(^{
	singletone = [Singletone new];
});

ODDispatchAfter

// Before 
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
}

// After
ODDispatchAfterInMainThread(2, ^{
});

ODDispatchAsyncInMainThread

// Before 
dispatch_async(dispatch_get_main_queue(), ^{
});

// After
ODDispatchAsyncInMainThread(^{
});

ODDispatchAsyncInBackgroundThread

// Before 
dispatch_async(dispatch_get_global_queue(priority, 0), ^{
});

// After
ODDispatchAsyncInBackgroundThread(^{
});

Installation

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

pod 'ODDispatch'

Author

Alexey Nazarov, alexx.nazaroff@gmail.com

License

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

About

Header-only GCD/DispatchQueue syntax sugar for ObjC 🚦

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0