如何使用可选的func textViewDidEndEditing(textView:UITextView)来更改输入的文本?

时间:2015-09-14 04:58:07

标签: ios objective-c swift swift2

起初我想为它做一个无限循环:

while stringLength == textView.text.characters.count{
                text.addAttribute(NSForegroundColorAttributeName, value: UIColor.redColor(), range: nsString.rangeOfString("hello"))
                    text.addAttribute(NSForegroundColorAttributeName, value: UIColor.redColor(), range: NSMakeRange(0, stringLength))

然而有人向我指出,更改在TextView中输入的文本的最佳方法是使用可选的func textViewDidEndEditing(textView: UITextView)

我查看了苹果文档,一些教程和一些谷歌搜索,但似乎没有人告诉我将如何完成或一般如何使用可选功能。

我不介意阅读,所以如果有人想指出我正确的文件,我会非常乐意看到它。我只是找不到自己。编码非常新。

0 个答案:

没有答案