Domainer
Multi-domain mapper.
This library provides manage multi-domain table.
Features
- Manage multi-domain mapping main domain.
 - Find best domain which with low latency.
 - Bypass dns resolver when IP table exists the domain.
 - Swizzle NSURLRequest method in runtime.
 
Installation
Domainer requires iOS 7.0 or later.
Using CocoaPods
-  
Add the pod
Domainerto your Podfile.pod 'Domainer' -  
Run
pod installfrom Terminal, then open your app's.xcworkspacefile to launch Xcode. -  
Import the
Domainer.hheader. Typically, this should be written as#import <Domainer.h> 
Using Carthage
-  
Add the
felixLinBH/Domainerproject to your Cartfile.github "felixLinBH/Domainer" -  
Run
carthage update, then follow the additional steps required to add the iOS and/or Mac frameworks into your project. -  
Import the Domainer framework/module.
- Using Modules: 
@import Domainer - Without Modules: 
#import <Domainer.h> 
 - Using Modules: 
 
Usage example
###Create domain table with Json format###
[
{"mainDomainName":"www.mainDomain.com","mapping":["www.domain1.com","www.domain2.com","www.domain3.com"]}
,
{"mainDomainName":"www.mainDomain2.com","mapping":["www.domain4.com","www.domain5.com","www.domain6.com"]}
] 
###Set mapping###
[Domainer setMapper:jsonArray];
 
###Run with callback###
[Domainer runWithCompleteHandler:^(BOOL sucess, NSArray *noResolvedDomain) {
	if(sucess){
	 //Start query some api...
	};
}];
 
Example
To run the example project, clone the repo, and run pod install from the Example directory first.
Contribute
We would love for you to contribute to Domainer, check the LICENSE file for more info.
Author
License
Domainer is available under the MIT license. See the LICENSE file for more info.
