 //	MARK: UITextField Closures Extension
 
 /**
- `UITextField`
+    `UITextField`
  
- This extension to UITextField adds the ability to assign closures to what would usually need to be delegate methods.
+    This extension to UITextField adds the ability to assign closures to what would usually need to be delegate methods.
  */
 public extension UITextField {
     
     //	MARK: Associated Keys Struct
     
     /**
-     `AssociatedKeys`
+        `AssociatedKeys`
      
-     A private struct which holds the keys for retrieving associated values.
+        A private struct which holds the keys for retrieving associated values.
      */
     private struct AssociatedKeys {
         /// The handle for retrieving or storing the text field delegate as an associated value.
-        static var textFieldDelegateHandle: NSString = "textFieldDelegateHandle"
+        static var textFieldDelegateHandle = "textFieldDelegateHandle"
         
         /// The handle for retrieving or storing the `shouldBeginEditingClosure` as an associated value.
-        static var textFieldShouldBeginEditingHandle: NSString = "textFieldShouldBeginEditingHandle"
+        static var textFieldShouldBeginEditingHandle = "textFieldShouldBeginEditingHandle"
         /// The handle for retrieving or storing the `shouldEndEditingClosure` as an associated value.
-        static var textFieldShouldEndEditingHandle: NSString = "textFieldShouldEndEditingHandle"
+        static var textFieldShouldEndEditingHandle = "textFieldShouldEndEditingHandle"
         
         /// The handle for retrieving or storing the `didBeginEditingClosure` as an associated value.
-        static var textFieldDidBeginEditingHandle: NSString = "textFieldDidBeginEditingHandle"
+        static var textFieldDidBeginEditingHandle = "textFieldDidBeginEditingHandle"
         /// The handle for retrieving or storing the `didEndEditingClosure` as an associated value.
-        static var textFieldDidEndEditingHandle: NSString = "textFieldDidEndEditingHandle"
+        static var textFieldDidEndEditingHandle = "textFieldDidEndEditingHandle"
         
         /// The handle for retrieving or storing the `shouldChangeCharactersClosure` as an associated value.
-        static var textFieldShouldChangeCharactersHandle: NSString = "textFieldShouldChangeCharactersHandle"
+        static var textFieldShouldChangeCharactersHandle = "textFieldShouldChangeCharactersHandle"
         
         /// The handle for retrieving or storing the `shouldClearClosure` as an associated value.
-        static var textFieldShouldClearHandle: NSString = "textFieldShouldClearHandle"
+        static var textFieldShouldClearHandle = "textFieldShouldClearHandle"
         /// The handle for retrieving or storing the `shouldReturnClosure` as an associated value.
-        static var textFieldShouldReturnHandle: NSString = "textFieldShouldReturnHandle"
+        static var textFieldShouldReturnHandle = "textFieldShouldReturnHandle"
     }
     
     //	MARK: Type Aliases

    //	MARK: Delegate Management
    
    /**
     Manages the fact that we need to be the delegate for this UITextField, but there may be an object that also wants to be the delegate.
     */
    private func manageDelegate() {
        //  if we are not our own delegate we need to set ourselves as such but keep the old delegate for messaging where appropriate

    /// The closure to be called to determine whether the chracters in the text field should change.
    var shouldChangeCharactersClosure: TextFieldChangeCharacters? {
        get {
            guard let boxedValue = objc_getAssociatedObject(self, &AssociatedKeys.textFieldShouldChangeCharactersHandle) as? Box<TextFieldChangeCharacters> else { return nil }
            return boxedValue.value
        }
        set {
            let boxedValue: Box<TextFieldChangeCharacters>? = newValue != nil ? Box(value: newValue!) : nil
            objc_setAssociatedObject(self, &AssociatedKeys.textFieldShouldChangeCharactersHandle, boxedValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
            manageDelegate()
        }
    }
