Skip to content

Instantly share code, notes, and snippets.

@jverkoey
Created June 23, 2012 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jverkoey/2977453 to your computer and use it in GitHub Desktop.
Save jverkoey/2977453 to your computer and use it in GitHub Desktop.
NIAttributedLabel Example 4
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: hello@nimbuskit.info"
@"\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