From http://appcocoa.blogspot.ca/2012/09/subclass-uitextfield.html