Commit a59e414b authored by 刘俊宏's avatar 刘俊宏

完善联系人信息

parent 2a4ba4b7
......@@ -10,7 +10,7 @@ import UIKit
import LGButton
import ContactsUI
class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate{
class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate,UITextViewDelegate{
@IBOutlet weak var messageCountLbl: UILabel!
@IBOutlet weak var messageTV: UITextView!
......@@ -24,6 +24,8 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
self.view.addSubview(navbar)
SetTopFrame(view: contentV, height: 370)
messageTV.delegate = self
}
@IBAction func gotoPhoneAccoutAction(_ sender: UIButton) {
print("gotoPhoneAccoutAction-获取通讯录")
......@@ -61,5 +63,21 @@ class XiaDanUserInfoViewController: BaseViewController , CNContactPickerDelegate
print("sureUserInfoAction-确定")
}
func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
messageCountLbl.text = "(\(textView.text.count)/200)"
if (textView.text.count == 200)
{
textView.text = textView.text.subString(start: 0, length: 200)
}
return true
}
func textViewDidChange(_ textView: UITextView) {
if textView.markedTextRange == nil {
if textView.text.count > 200 {
textView.text = textView.text.subString(start: 0, length: 200)
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment