Created
June 23, 2012 07:50
-
-
Save jverkoey/2977453 to your computer and use it in GitHub Desktop.
NIAttributedLabel Example 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NIAttributedLabel* label = [[NIAttributedLabel alloc] initWithFrame:CGRectZero]; | |
label.numberOfLines = 0; | |
label.lineBreakMode = UILineBreakModeWordWrap; | |
label.autoresizingMask = UIViewAutoresizingFlexibleDimensions; | |
label.frame = CGRectInset(self.view.bounds, 20, 20); | |
label.font = [UIFont fontWithName:@"Optima-Regular" size:20]; | |
label.delegate = self; | |
label.autoDetectLinks = YES; | |
// Turn on all available data detectors. This includes phone numbers, email addresses, and | |
// addresses. | |
label.dataDetectorTypes = NSTextCheckingAllSystemTypes; | |
label.text = @"She presses a button next to the display and it flickers once more." | |
@"\n\nUpon the arrival at Gliese 581 g, initiate contact with the following:" | |
@"\n\nCall: 555-0131" | |
@"\nEmail: [email protected]" | |
@"\nMail: 123 Nimbus Ln."; | |
[self.view addSubview:label]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment