-
Copy the
domainr
folder into your project. -
Have a
#import Domainr.h
in your source code:#import Domainr.h
-
Instantiate a new instance of the
Domainr
class:Domainr *d = [[Domainr alloc] init];
-
Call the appropriate method on the object (
search
andinfo
are available):// stores the search result in a searchResult variable // parameter is (a) keyword(s) passed via string id searchResult = [d search:@"connor"];
// stores the info result in an infoResult variable // parameter is a URL passed via a string id infoResult = [d info:@"cnnr.me"];
The return type of both method calls is an NSDictionary
that mirrors
the JSON responses Domainr specifies here
and here.
I have examples of the method calls in main.m. The easiest way to see this in action is to open the Xcode project up and run it. You will see the log populate with the responses from Domainr.
- Make an async version
- Make an ARC-friendly version
A huge thank you to Joshua Russell for his Dribbble API Wrapper, which provided a great starting point for an Objective-C n00b like myself to make this. <3