         // As a navigation item
         let navigationSegmentedControl = BetterSegmentedControl(
             frame: CGRect(x: 35.0, y: 40.0, width: 200.0, height: 30.0),
-            titles: ["Lights On", "Lights Off"],
+            titles: LightMode.allValuesString,
             index: 0,
             backgroundColor: .darkGrayColor(),
             titleColor: .lightGrayColor(),

    }
    
    func navigationSegmentedControlValueChanged(sender: BetterSegmentedControl) {
        if sender.index == 0 {
            print("Turning lights on.")
            view.backgroundColor = .whiteColor()
        }
        else {
            print("Turning lights off.")
            view.backgroundColor = .darkGrayColor()
        }
    }
    
    @IBAction func segmentedControl1ValueChanged(sender: BetterSegmentedControl) {

import BetterSegmentedControl

class ViewController: UIViewController {

    enum LightMode: String {
        //enum values are the same as what's expected in the request API
        case Off = "Lights Off"
        case On = "Lights On"
        
        static let allValues = [On, Off]
        static let allValuesString = [On.rawValue, Off.rawValue]
        
    }
    
    @IBOutlet weak var control1: BetterSegmentedControl!
    @IBOutlet weak var control3: BetterSegmentedControl!
