         return true
     }
     
+    public func textFieldDidBeginEditing(_ textField: UITextField) {
+        // Set the focussed state
+        updateButtonStates()
+    }
 }
 
 // MARK - Internal

        let showsHint = state?.showsHint == true
        
        for (i, button) in buttons.enumerated() {
            if let newCharacter = textField.text?[i],
                newCharacter != "" {
                button.setTitle(newCharacter, for: .normal)

            else {
                button.setTitle(showsHint ? state?.pin?.uppercased()[i] : nil, for: .normal)
                button.setTitleColor(.lightGray, for: .normal)
                
                let isFocussed = textField.isFirstResponder && i == textField.text?.characters.count ?? 0
                if isFocussed {
                    button.layer.borderColor = UIColor.black.cgColor
                }
            }
        }
    }
}
