Latest 1.0
License MIT
Platforms ios 8.0, requires ARC

ActionLabel Badge w/ Version Platform Carthage compatible Build Status license MIT

Custom UILabel replacement to recognize, colorize and allow custom action handlers for Hashtags (#), Mentions (@) and URLs (http/https).


  • Swift 2+
  • Support #Hashtags, @Mentions and http://links
  • Replacement for UILabel to use in Posts
  • Easy installation and customization


import ActionLabel

let label = ActionLabel()

//Custom Label Setup
label.text = "Post text #with #multiple #hashtags and some users like @carlosalcala or @twitter. Links are also supported like or"
label.textColor = .blackColor()
label.hashtagColor = .blueColor()
label.linkColor = .blueColor()
label.mentionColor = .blueColor()

//hashtag custom handler
label.hashtagHandler { hashtag in
  print("Tapped the (hashtag) hashtag")

//set frame
label.frame = CGRect(x: 10, y: 100, width: view.frame.width - 20, height: 500)

//add to current view

Install (iOS 8+)


Add the following to your Cartfile and follow these instructions

github "devcarlos/ActionLabel"


To integrate ActionLabel into your project add the following to your Podfile:

platform :ios, '8.0'

pod 'ActionLabel'


ActionLabel is based mostly on ActiveLabel project but most of the recognition and regular expression logic has been rewritten, moved and improved to be a more DRY Pattern, module and single class to make this is a more simple control ready for customization.

  • ActiveLabel (Swift) – UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
  • TTTAttributedLabel (ObjC) – A drop-in replacement for UILabel that supports attributes, data detectors, links, and more
  • STTweetLabel (ObjC) – A UILabel with #hashtag @handle and links tappable
  • AMAttributedHighlightLabel (ObjC) – A UILabel subclass with mention/hashtag/link highlighting
  • KILabel (ObjC) – A simple to use drop in replacement for UILabel for iOS 7 and above that highlights links such as URLs, twitter style usernames and hashtags and makes them touchable


ActionLabel is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "ActionLabel",
    "version": "1.0",
    "summary": "Custom drop-in UILabel replacement that recognize and handle Hashtags (#), Mentions (@) and URLs (http://) written in Swift.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Carlos Alcala": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "1.0"
    "source_files": "ActionLabel/*.swift",
    "requires_arc": true

Pin It on Pinterest

Share This