UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
- Up-to-date: Swift 2 (Beta 6)
- Support for Hashtags, Mentions and Links
- Super easy to use and lightweight
- Works as
UILabel
drop-in replacement - Well tested and documented
import ActiveLabel
let label = ActiveLabel()
label.numberOfLines = 0
label.text = "This is a post with #hashtags and a @userhandle."
label.textColor = .blackColor()
label.handleHashtagTap { hashtag in
print("Success. You just tapped the \(hashtag) hashtag")
}
label.handleMentionTap { userHandle in print("\(userHandle) tapped") }
label.handleHashtagTap { hashtag in print("\(hashtag) tapped") }
label.handleURLTap { url in UIApplication.sharedApplication().openURL(url) }
Add the following to your Cartfile
and follow these instructions
github "optonaut/ActiveLabel.swift" >= 0.1.0