Skip to content

Add link text to label and make it clickable^_^ [Especially useful for Terms of Use & Privacy Policy]

License

Notifications You must be signed in to change notification settings

tounaobun/JGJLinkLabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JGJLinkLabel

Add link text to label and make it clickable (multiple lines are also supported.)

Support Cocoapods.

pod 'JGJLinkLabel'

Usage:

    JGJLinkLabel *linkLabel = [[JGJLinkLabel alloc] init];
    [self.view addSubview:linkLabel];
    linkLabel.numberOfLines = 0;
    linkLabel.linkColor = [UIColor redColor];
    linkLabel.text = @"By tapping ‘Register’, you have read and agree to the Terms of Use and Privacy Policy";
    
    [linkLabel addLinkText:@"Terms of Use" clickHandler:^{
        NSLog(@"Clicked Terms of Use.");
    }];
    [linkLabel addLinkText:@"Privacy Policy" clickHandler:nil];
    
    [linkLabel setClickLinkGlobalHandler:^(NSString *linkText) {
        NSLog(@"Clicked %@", linkText);
    }];

Screenshot:

alt text

Todo list:

  1. Add Swift version.
  2. link text applied for multiple matches.(Current version only applied to the first matched.)

About

Add link text to label and make it clickable^_^ [Especially useful for Terms of Use & Privacy Policy]

Resources

License

Stars

Watchers

Forks

Packages

No packages published