 			delay: 0,
 			options: .BeginFromCurrentState | .CurveEaseInOut | .AllowAnimatedContent | .AllowUserInteraction,
 			animations: {
-				self.inputView.backgroundColor = self.keyboardBackgroundColorForAppearance(.Default)
+				self.inputView.backgroundColor = KeyboardViewController.keyboardBackgroundColorForAppearance(.Default)
 			},
 			completion: nil)
 	}

    override func viewDidLoad() {
        super.viewDidLoad()
		
        // Perform custom UI setup here
		self.nextKeyboardButton = UIButton.buttonWithType(.System) as UIButton
		nextKeyboardButton.setImage(UIImage(named: "Globe"), forState: .Normal)
		nextKeyboardButton.sizeToFit()
		nextKeyboardButton.setTranslatesAutoresizingMaskIntoConstraints(false)
        nextKeyboardButton.addTarget(self, action: "advanceToNextInputMode", forControlEvents: .TouchUpInside)
        self.view.addSubview(nextKeyboardButton)
		
		// Auto layout
		let views = [
			"nextKeyboardButton": nextKeyboardButton
		]
		self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-(54)-[nextKeyboardButton]", options: nil, metrics: nil, views: views))
		self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[nextKeyboardButton]-(13)-|", options: nil, metrics: nil, views: views))
		
		// Gestures
		let swipeLeft = UISwipeGestureRecognizer(target: self, action: "didSwipeLeft:")

class KeyboardViewController: UIInputViewController {

	@IBOutlet var nextKeyboardButton: UIButton
	
	let row1Letters = ["Q","W","E","R","T","Y","U","I","O","P"]
	let row2Letters = ["A","S","D","F","G","H","J","K","L"]
	let row3Letters = ["Z","X","C","V","B","N","M"]
	
	var row1Labels = Dictionary<String, UILabel>()
	var row2Labels = Dictionary<String, UILabel>()
	var row3Labels = Dictionary<String, UILabel>()
	
	let row1 = KeyboardViewController.createRow()
	let row2 = KeyboardViewController.createRow()
	let row3 = KeyboardViewController.createRow()
	let row4 = KeyboardViewController.createRow()
	
	class func createRow() -> UIView {
		let view = UIView()
		view.setTranslatesAutoresizingMaskIntoConstraints(false)
		
		let divider = UIView()
		divider.setTranslatesAutoresizingMaskIntoConstraints(false)
		divider.backgroundColor = KeyboardViewController.dividerColorForAppearance(UIKeyboardAppearance.Default)
		view.addSubview(divider)
		
		let views = ["divider": divider]
		view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[divider]|", options: nil, metrics: nil, views: views))
		view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[divider(0.5)]|", options: nil, metrics: nil, views: views))
		
		return view
	}

    init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
