Latest 0.5.0
License MIT
Platforms ios , requires ARC

build status
Coverage Status

MSPTouchableLabel is a UILabel subclass which provides a UITableView -like interface for creating interactive labels. It has no dependencies.

The public API of this pod may change since a 1.0.0 release hasn’t been reached. Please use caution when upgrading. Not recommended for use in production apps.


Add pod 'MSPTouchableLabel' to your Podfile and run pod install or pod update.


Most basic usage:

  • Instantiate an MSPTouchableLabel.
  • Set the label’s dataSource.
  • Implement the MSPTouchableLabelDataSource method textForTouchableLabel:.
  • Add the label to your view.

You can optionally implement MSPTouchableLabelDelegate methods to find out about interaction with the label, as shown below:

#import "MSPTouchableLabel.h"

@interface BasicUsageViewController()<MSPTouchableLabelDataSource, MSPTouchableLabelDelegate>

@property (nonatomic, strong) NSNumber* tapCount;


@implementation BasicUsageViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    MSPTouchableLabel* touchableLabel = [[MSPTouchableLabel alloc] init];
    touchableLabel.dataSource = self;
    touchableLabel.delegate = self;
    touchableLabel.frame = CGRectMake(20, 20, 200, 200);
    [self.view addSubview:touchableLabel];

    self.tapCount = @0;

- (NSArray*)textForTouchableLabel:(MSPTouchableLabel*)touchableLabel {
    return @[@"You have ", @"tapped", @" the verb in this sentence ", self.tapCount.stringValue, @" times."];

- (void)touchableLabel:(MSPTouchableLabel*)touchableLabel touchesDidEndAtIndex:(NSInteger)index {
    if (index == 1) {  // index of the verb, "tapped"
        self.tapCount = @(self.tapCount.intValue + 1);


For larger examples, clone this repository and see the Examples directory. Run the project to see them in action (or glance at the .gifs at the bottom of this document).


  1. Fork this repository and make your changes.
  2. Write a test which indicates your bug fix or feature’s intent and demonstrates that it works as expected.
  3. Send a pull request 😁. I’ll make my best effort to respond promptly.



See also

A few example applications:

Replace text upon tap:

replace text



Mad libs:

mad libs



Latest podspec

    "name": "MSPTouchableLabel",
    "version": "0.5.0",
    "summary": "UILabel subclass with UITableView -like data source and delegate for easy dynamic labels.",
    "description": "The MSPTouchableLabel class is a UILabel subclass which provides an interfacenfor easy interaction and updates. It offers a data source and delegate fornyou to dynamically update its contents.",
    "homepage": "",
    "screenshots": [
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Michael Pace": "[email protected]"
    "platforms": {
        "ios": null
    "source": {
        "git": "",
        "tag": "0.5.0"
    "source_files": "Source/MSPTouchableLabel.{h,m}",
    "requires_arc": true

Pin It on Pinterest

Share This