{% extends "dashboard/base.html" %} {% block title %}A/B Testing Quick Start - {{ block.super }}{% endblock %} {% block body_id %}ab-quickstart{% endblock %} {% block body_class %}secondary dashboard{% endblock %} {% block extra_head %} {% endblock %} {% block main %}

Quick Start for A/B Testing {{ app.name }}

1. Download the Clutch A/B Testing Framework for iOS

Download the Clutch iOS Library zip file and extract it.

Now drag the Clutch.framework folder into your project: Dragging the Clutch Framework Into Your Project

Choose the option to "Copy items into destination group's folder": Choosing to copy items into destination group's folder

Since Clutch relies on sqlite, add that to your linked frameworks as well: Adding sqlite

2. Set up the A/B Testing Framework in Your App Delegate

In your AppDelegate.h file, right underneath “#import <UIKit/UIKit.h>”, import the Clutch A/B testing library:

#import <Clutch/ClutchAB.h>
In didFinishLaunchingWithOptions add the following lines:
// Set up Clutch A/B testing
[ClutchAB setupForKey:@"{{ app_key }}" rpcURL:@"http://127.0.0.1:41674/"];

3. Start A/B Testing!

Now you’re set up to run A/B tests, and you can start adding as many tests as you want to your app. Here’s an example:

[ClutchAB testWithName:@"loginButtonColor" A:^{
    self.navigationItem.rightBarButtonItem.tintColor = [UIColor redColor];
} B:^{
    self.navigationItem.rightBarButtonItem.tintColor = [UIColor greenColor];
}];
For more information, visit our iOS A/B testing docs.

{% endblock %}