         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()
     }
     
     /*!


class ConfigViewController: UIViewController {
    
    /*!
     * Overrides UIViewController::viewDidLoad()
     */

            ypos += iconSize + 10
            i++
        }
        orientation.selectedSegmentIndex = orientationValue
        container.addSubview(orientation)
        
        self.view.addSubview(container)
