在iOS程序中检测数字和链接
在程序中检测数字和链接 在iPhone 3.0后就支持UIDataDetectorTypes来检测数字和链接。 UIDataDetectorTypePhoneNumber UIDataDetectorTypeLink UIDataDetectorTypeNone UIDataDetectorTypeAll 通过设置dataDetectorTypes属性就可以实现功能 - (void)viewDidLoad { - self.textView.dataDetectorTypes = UIDataDetectorTypeAll; - } 同时你也可以通过Interface Builder来设置属性。 本文转自 arthurchen 51CTO博客,原文链接:http://blog.51cto.com/arthurchen/801306,如需转载请自行联系原作者