UITextView中检测链接时,如何过滤掉日期等

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// 这个是默认的
textView.dataDetectorTypes = UIDataDetectorTypeAll;
// 保留电话和链接
textView.dataDetectorTypes = UIDataDetectorTypeLink | UIDataDetectorTypePhoneNumber;
// 这个是默认的 textView.dataDetectorTypes = UIDataDetectorTypeAll; // 保留电话和链接 textView.dataDetectorTypes = UIDataDetectorTypeLink | UIDataDetectorTypePhoneNumber;
// 这个是默认的
textView.dataDetectorTypes = UIDataDetectorTypeAll;
// 保留电话和链接
textView.dataDetectorTypes = UIDataDetectorTypeLink | UIDataDetectorTypePhoneNumber;

 

Leave a Reply

Your email address will not be published. Required fields are marked *