UITextView
textView.userInteractionEnabled = false
सेट करें और यदि आपके पास UITextField
है, तो textField.userInteractionEnabled = false
सेट करें।
आप, के बाद इसके साथ सेल उपयोग किया जाता है TextView या पाठ फ़ील्ड संपादन योग्य होना चाहता हूँ कुछ इस तरह करते हैं:
func textFieldDidEndEditing(textField: UITextField) {
textField.userInteractionEnabled = false
// rest of the function
}
func textViewDidEndEditing(textView: UITextView) {
textView.userInteractionEnabled = false
// rest of the function
}
:
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
let cell = tableView.cellForRowAtIndexPath(indexPath)! as UITableViewCell
// find first textField inside this cell and select it
for case let textField as UITextField in cell.subviews {
textField.userInteractionEnabled = true
textField.becomeFirstResponder()
return
}
// find first textView inside this cell and select it
for case let textView as UITextView in cell.subviews {
textView.userInteractionEnabled = true
textView.becomeFirstResponder()
return
}
}
तो उपयोगकर्ता बातचीत निष्क्रिय करने के लिए संपादन समाप्त कर लेने के बाद यह सुनिश्चित कर लें
मत भूलना UITextFieldDelegate
और/या UITextViewDelegate
मुझे आशा है कि इस मदद की किसी को :)
01 सेट करने के लिए
userInteractionEnabled = कोई काम नहीं किया। बहुत बहुत धन्यवाद। –
एक टेक्स्ट व्यू में सक्षम संपत्ति नहीं है। –