Swift 2.1 - 将信息输入到同时填充文本字段的 TextView 中?

Swift 2.1 - Inputing information into a TextView which populates a Textfield at the same time?

我目前正在使用一个名为 "Swift Validator" 的框架,它只允许使用文本字段。在我的例子中,我需要一个 textView,我的问题是如何将我输入的信息输入到 textview 中,然后同时在后台填充一个文本字段?以及删除输入的文本时?

使用 UITextViewDelegate 方法 textViewDidChange 监听文本视图的变化。调用该方法时,更新文本字段。这是一个例子:

func textViewDidChange(theTextView: UITextView) {
    self.textField.text = theTextView.text   
}

不要忘记扩展 UITextViewDelegate 并将文本视图的委托设置为 self