Code from the custom keyboard tutorial on www.weheartswift.com