An UILabel with #hashtag @name http:// tappable
Switch branches/tags
Nothing to show
Pull request Compare This branch is 202 commits behind SebastianThiebaud:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
STTweetLabel
STTweetLabelExample
LICENSE
README.md
STTweetLabel.podspec
screenshot.png

README.md

STTweetLabel

A custom UILabel view controller for iOS with certain words tappable like Twitter (#Hashtag, @People and http://www.link.com/page)

STTweetLabel screenshot

Documentation

You need only 2 files:

  • STTweetLabel.h
  • STTweetLabel.m

Don't forget to implement STLinkProtocol and initialize the STTweetLabel's delegate in the view controller which manages your STTweetLabel (see the example in the project).

You can change the fonts and colors for the different words (#Hashtag/@People AND http://link.com) via the STTweetLabel attributes.

Demo

Build and run the project in Xcode to see STTweetLabel in action.

Example Usage

    STTweetLabel *tweetLabel = [[STTweetLabel alloc] initWithFrame:CGRectMake(20.0, 60.0, 280.0, 200.0)];
    
    [tweetLabel setFont:[UIFont fontWithName:@"HelveticaNeue" size:17.0]];
    [tweetLabel setTextColor:[UIColor blackColor]];
    [tweetLabel setDelegate:self];
    [tweetLabel setText:@"Hi. This is a new tool for @you! Developed by->@SebThiebaud for #iPhone #ObjC... ;-) My GitHub page: https://t.co/pQXDoiYA"];
    [self.view addSubview:tweetLabel];

When an user will click on a tappable word, the delegate method - (void)tweetLinkClicked:(NSString *)link will be called. The word clicked by the user is the parameter (NSString *)link.

Credits

Inspired by the original Twitter applications.

Contact

Sebastien Thiebaud

License

STTweetLabel is available under the MIT license.