Latest 1.1.0
Homepage https://github.com/jeremytregunna/picker
License MIT
Platforms ios 8.0, requires ARC
Authors

Travis CI

Picker is a different kind of A/B testing library. It doesn’t feature a fancy
algorithm, it’s not limited to just a small handfull of choices. It also doesn’t
require constant tuning. What good is it then? Well, it’s a library you can set
and forget. It’ll always pick the current best thing to do. It’s also self
adjusting, so you don’t need to babysit it. Finally, it can take an arbitrary
number of choices and give you a good choice back.

Installation

You can use CocoaPods, or anything else you like. For CocoaPods, point at this
repository.

pod 'Picker'

Usage

// Keep a reference to this
let picker = Picker(["orange", "blue", "green"], recorder: self)

// …

// Where you want to make the choice
let choice = picker.choose()
// …use the choice to display or do whatever it is you want.

// …
// User did the thing you want, tell the picker
picker.reward("orange")

That’s it, you’re done. You will probably want to record the decisions made
somewhere, to do that, you’ll want to implement the pickerRecord(choice:)
method. For instance:

struct Recorder: PickerRecordable {
    func pickerRecord(choice choice: Choice) {
        saveChoice(choice)
    }
}

// Somewhere, wherever you create the picker, do it like this:
let picker = Picker(["orange", "blue", "green"], recorder: yourRecorderInstance)

The picker will take ownership of that instance, so you don’t need to keep your
own around. If you keep a reference to the picker on yourRecorderInstance,
then you’ll want to ensure you break the reference manually.

License

See the LICENSE.md file for more information.

Latest podspec

{
    "name": "Picker",
    "version": "1.1.0",
    "license": {
        "type": "MIT"
    },
    "summary": "Lightweight A/B testing library for Swift",
    "homepage": "https://github.com/jeremytregunna/picker",
    "authors": {
        "Jeremy Tregunna": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jeremytregunna/picker.git",
        "tag": "1.1.0"
    },
    "social_media_url": "https://twitter.com/jtregunna",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Picker/*"
}

Pin It on Pinterest

Share This