     self.textField.autocapitalizationType = self.autocapitalizationType;
     self.textField.delegate = self
     self.textField.addTarget(self, action: #selector(FA_TokenInputView.onTextFieldDidChange(_:)), forControlEvents: .EditingChanged)
+    self.textField.addTarget(self, action: #selector(FA_TokenInputView.onTextFieldDidEndEditing(_:)), forControlEvents: .EditingDidEnd)
     self.addSubview(self.textField)
     
     self.fieldLabel = UILabel(frame: CGRectZero)

      availableWidthForTextField = rightBoundary - curX
    }
    
    var textFieldRect = self.textField.frame
    textFieldRect.origin.x = curX
    textFieldRect.origin.y = curY
    textFieldRect.size.width = availableWidthForTextField
    textFieldRect.size.height = FA_TokenInputView.STANDARD_ROW_HEIGHT
    self.textField.frame = textFieldRect
    
    let oldContentHeight = self.intrinsicContentHeight
    self.intrinsicContentHeight = CGRectGetMaxY(textFieldRect)+FA_TokenInputView.PADDING_BOTTOM
    self.invalidateIntrinsicContentSize()
    
    if (oldContentHeight != self.intrinsicContentHeight) {

    self.backgroundColor = UIColor.whiteColor()
    
    self.displayMode = mode
    self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(FA_TokenInputView.viewWasTapped)))
    self.heightZeroConstraint = NSLayoutConstraint(item: self, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1.0, constant: 0.0)
  }
  
