Latest 0.1.0
License MIT
Platforms ios 8.0, requires ARC

A shameless fork of Krelborn/KILabel that replaces auto link detection with manual adding links.


Use TapLabel.LinkContentName to apply link to attributed text, and TapLabel.SelectedForegroudColorName to specify selected foreground color. TapLabel will not apply any other customized color to text. You have to defined your own.

let text = NSMutableAttributedString(string: "something contains a link")

    value: "test",
    range: NSMakeRange(26, 42))
    value: UIColor.blueColor(),
    range: NSMakeRange(26, 42))
    value: UIColor.redColor(),
    range: NSMakeRange(26, 42))

let label = TapLabel(frame: CGRect(x: 20, y: 40, width: 280, height: 100))
label.attributedText = text


Delegate property on label must be assigned for tap action to work.

  • func tapLabel(tapLabel: TapLabel, didSelectLink link: String)

    Will be called once TapLabel.LinkContentName specifyed text is tapped. link will equal to the value of TapLabel.LinkContentName.

Latest podspec

    "name": "TapLabel",
    "version": "0.1.0",
    "summary": "Add links and actions to UILabel.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Daiwei Lu": "[email protected]"
    "source": {
        "git": "",
        "tag": "v0.1.0"
    "source_files": "Source/**/*.{h,swift}",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0"

Pin It on Pinterest

Share This