I'm no longer actively maintaining this project. If you are interested supporting it - ping me on twitter.
A UILabel subclass, that adds highlighting support to labels. Supporting hashtags, mentions, urls and having the ability to recognize custom texts. Written in Swift.
use_frameworks!
pod 'RDSActionLabel'
let label = RDSActionLabel()
label.text = "Comment containing several #hash-1 #hash-2 from @username linking to http://example.com"
label.matchUsername(color: mentionColor, selectedColor: mentionSelectedColor) { self.selectUser($0) }
label.matchHashtag(color: hashtagColor, selectedColor: hashtagSelectedColor) { self.selectHash($0) }
label.matchUrl(color: URLColor, selectedColor: URLSelectedColor) { self.selectUrl($0) }
let label = RDSActionLabel()
label.match("custom regular expression", color: color, selectedColor: selectedColor) { self.handle($0) }
#import "RDSActionLabel-Swift.h"
RDSActionLabel *label = [RDSActionLabel new]
// you can pass `nil` for using the default values
[self.legalLabel matchUrlWithColor:urlColor selectedColor:selectedUrlColor handle:^(NSString * _Nonnull urlString) {
[self handleUrl:urlString];
}];
gem install scan
./bin/test
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Run the tests
- Create new Pull Request