         self.view.addSubview(backButton)
     }
     
+    /*!
+     * Handler for the segmented control actions.
+     *
+     * Saves the choice to the NSUserDefaults.
+     *
+     * @param sender
+     */
     func orientationSelect(sender: UISegmentedControl) {
-        println("\(sender.selectedSegmentIndex)")
+        NSUserDefaults.standardUserDefaults().setInteger(sender.selectedSegmentIndex, forKey: self.orientationKey)
+        NSUserDefaults.standardUserDefaults().synchronize()
     }
     
     /*!

        var ypos = CGFloat(70)
        
        let container = UIScrollView(frame: CGRectMake(0, 20, self.view.frame.width, self.view.frame.height - 20))
        
        let iconSize = CGFloat(72)
        var orientation = UISegmentedControl()


class ConfigViewController: UIViewController {
    
    let orientationKey = "RunalysisRunViewOrientation"
    
    /*!
     * Overrides UIViewController::viewDidLoad()
     */
