Latest | 0.0.1 |
---|---|
Homepage | https://github.com/Matzo/Jails |
License | MIT |
Platforms | ios 5.0, requires ARC |
Authors |
AB testing framework for native apps of iOS.
iOS
Require
- iOS 5.0 and later
Install
Using CocoaPods
Add below to your Podsfile.
pod "Jails"
Manual installation
- Open project on Xcode.
- Select scheme
Jails > iOS Device
thenProject > Build
. - Select scheme
Jails > iPhone 5.0 Simulator
thenProject > Build
. - Copy built
libJails.a
andJails.h
fromRelease-universal or Debug-universal
into your project. - Add
-ObjC -all_load
toOther Linker Flags
of Build Setting.
Sample Code
// AppDelegate.m
#import "Jails.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
:
[Jails breakWithConfURL:[NSURL URLWithString:@"http://your.domain.com/path/to/conf/jails.json"]];
:
}
Jails.json
{"ClassNameOfViewController": [
{ "ratio": 0 }, // A: 0%
{ "ratio": 100, // B: 100%
"branchName": "b",
"properties": [{
"name": "scrollView",
"frame": ["+0", "+44", "+0", "-44"]
},
{
"name": "view",
"createSubviews": [{
"class": "UIButton",
"background": "http://button/image.png",
"frame": ["0", "0", "320", "44"],
"action": "http://open/this/url/"
}]
}]
}
]}
Key | required | Description |
---|---|---|
ClassNameOfViewController | o | This class name can be changed. You can specified subclasses of UIViewController or UIView. |
ratio | o | Percentage for A/B test. |
branchName | – | You can use this name as parameter for your analytics tools. |
properties | – | You can change each properties with specified name. |
Key for properties or createSubviews | required | Description |
---|---|---|
name | o | variable name as a property |
background | – | If you specified as URL of image, draw as pattern tile. Or, draw color if you specified HEX color code. |
frame | – | UIView’s frame for iOS. You can specify relatively position. |
text | – | For UILabel: changing labes’s text. For UIButton: change buttons title. For UIWebView: change html contents. |
action | – | For UIWebView: you can specify URL for HTML contetnts. For UIButton: you can specify URL for to call openURL:, or selector for addTarget:action:forControlEvents: |
hidden | – | Change visibility of UI perts. |
createSubview | – | You can use this param for original properties. So you cannot build tree hierarchy. |
Tools
- jails.json editor
http://matzo.github.io/jpon_demo/#jails-0_2.json
Latest podspec
{ "name": "Jails", "version": "0.0.1", "summary": "AB testing framework for iOS application.", "description": " Jails provide power to adjust UI dynamically via JSON format file.n Anytime you can do it without release.nn This library is recommended small AB testing.n", "homepage": "https://github.com/Matzo/Jails", "license": { "type": "MIT", "file": "LICENSE.txt" }, "authors": { "Matzo": "[email protected]" }, "platforms": { "ios": "5.0" }, "source": { "git": "https://github.com/Matzo/Jails.git", "tag": "0.0.1" }, "source_files": "iOS/Jails/Jails/*.{h,m}", "requires_arc": true }
Sun, 28 Feb 2016 22:26:02 +0000