在程序中检测数字和连接ios
在iPhone 3.0后就支持UIDataDetectorTypes来检测数字和连接。app
UIDataDetectorTypePhoneNumberide
UIDataDetectorTypeLinkui
UIDataDetectorTypeNone3d
UIDataDetectorTypeAllblog
经过设置dataDetectorTypes属性就能够实现功能ip
- (void)viewDidLoad {get
- self.textView.dataDetectorTypes = UIDataDetectorTypeAll;it
- }io
同时你也能够经过Interface Builder来设置属性。
参考: