Almost everywhere in the iPhone, you can type text and the OS will recognize portion of the text to be hyperlinks (phone numbers, email addresses for example). However I tested this in my own app with a UILabel and it doesn't work. How do I activate this?
Does the iphone sdk provide this functionality out of the box or do I have to do the parsing logic myself (which is a lot of work)?
You could use UITextView as follows:
UITextView *myView = [[UITextView alloc] initWithFrame: frame];
myView.text = @"this is http://google.com link";
myView.editable = NO;
myView.dataDetectorTypes = UIDataDetectorTypeLink;
//cell is the TableView's cell
[cell.contentView addSubview:myView];
[myView release];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With