在iOS程序中检测数字和连接

在程序中检测数字和连接ios

在iPhone 3.0后就支持UIDataDetectorTypes来检测数字和连接。app

UIDataDetectorTypePhoneNumberide

UIDataDetectorTypeLinkui

UIDataDetectorTypeNone3d

UIDataDetectorTypeAllblog

经过设置dataDetectorTypes属性就能够实现功能ip

- (void)viewDidLoad {get

- self.textView.dataDetectorTypes = UIDataDetectorTypeAll;it

- }io

clip_p_w_picpath002

同时你也能够经过Interface Builder来设置属性。

clip_p_w_picpath004

 

参考:

https://developer.apple.com/devcenter/ios/index.action

相关文章
相关标签/搜索