![](/img/trans.png)
[英]UITextView check whether text field is empty or not in Objective-C
[英]Check If UItextView Text Is Empty Once
我想在我的 UITextView 為空時調用動畫,當它不為空時再次調用。
我在下面的委托方法中得到了 UITextView 的變化;
func textViewDidChange(_ textView: UITextView) {
}
但是,這會在每次更改時檢查 UITextView 是否為空。 我只想調用一次。
有什么方法嗎?
此委托由UIKit
處理,因此無法在調用時進行選擇。 但是,根據Apple 文檔,還有這些其他選項:
func textViewDidBeginEditing(_ textView: UITextView)
func textViewDidEndEditing(_ textView: UITextView)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.