Objective-C Iglu client
The Iglu Objc client allows you to resolve JSON Schemas from embedded and remote repositories. It does not yet let you write to repositories in any way (e.g. you can't publish new schemas to an Iglu repository).
This client library should be straightforward to use if you are comfortable with Objective-C development.
Client compatibility
The Obj-C client is compatible with OSX 10.9+ and iOS 7.0+.
Dependencies
The library is dependant on KiteJSONValidator for all JSONSchema validation.
Setup
CocoaPods
We support installing the Obj-C Client via CocoaPods since it's the easiest way to install the client. Doing so is simple:
- Install CocoaPods using
gem install cocoapods - Create the file
Podfilein the root of your XCode project directory, if you don't have one already - Add the following line into it:
pod 'SnowplowIgluClient'
- Run
pod installin the same directory
Manual Setup
If you prefer not to use CocoaPods, you can grab the client from our GitHub repo and import it into your project.
Clone the client
First, git clone the latest version of the client to your local machine:
git clone https://github.com/snowplow/iglu-objc-client.git
If you don't have git installed locally, install it first.
Copy the client into your project
You first need to copy the client's SnowplowIgluClient sub-folder into your XCode project's folder. The command will look something like this:
cp -r iglu-objc-client/SnowplowIgluClient MyObjcApp/MyObjcApp/
- Replace
MyObjcAppwith the name of your own app, and tweak the source code sub-folder accordingly. - Next, drag and drop the sub-folder
MyObjcApp/MyObjcApp/SnowplowIgluClientinto your XCode project's workspace. - Make sure that the suggested options for adding
SnowplowIgluClientare set Create groups, then click Finish.
Copy required resources (Optional)
The client requires two schemas for initial operation; the first for validating that a JSON is a correct self-describing JSON and the second for validating the resolver-config JSON passed to it in startup. The client will look for these in a resource bundle named SnowplowIgluResources.
To get this bundle you will need to:
- Open the
SnowplowIgluClient.xcworkspacein XCode. - Build the
SnowplowIgluResourcesschema. - In your
Productsfolder within XCode you should now see aSnowplowIgluResources.bundle. - Copy this bundle to your project.
Alternatively you can also include the standard Snowplow repository in your resolver-config:
{
"name": "Iglu Central",
"vendorPrefixes": [
"com.snowplowanalytics"
],
"connection": {
"http": {
"uri": "https://iglucentral.com"
}
},
"priority": 0
}
This will allow the client to download the required schemas at runtime.
Initialization
Assuming you have completed the setup for your Objective-C project, you are now ready to initialize the Obj-C client.