Latest1.2.6.1
Homepagehttps://github.com/changsanjiang/SJLabel
LicenseMIT
Platformsios 8.0, requires ARC
FrameworksUIKit, CoreText
Authors

Use

pod 'SJLabel'

Example

- (void)test {
    NSAttributedString *attrStr = [[NSAttributedString alloc] initWithString:@"@迷你世界联机 :@江叔 用小淘气耍赖野人#迷你世界#. #精选#看到最后!! [点赞]!![评论]!!"];

    // 1. set `attributedString` delegate
    attrStr.actionDelegate = self;

    // 2. regular matching action
    attrStr.addAction(@"([@][^\s]+\s)|([#][^#]+#)|([\[][^\]]+\])");

    // 3. set str
    sjLabel.attributedText = attrStr;
}

/// Delegate Method
- (void)attributedString:(NSAttributedString *)attrStr action:(NSAttributedString *)action {
    NSLog(@"%@", action.string);
}

SJLabel


Latest podspec

{
    "name": "SJLabel",
    "version": "1.2.6.1",
    "summary": "A Text Label.",
    "description": "A Text Label. support clicked.",
    "homepage": "https://github.com/changsanjiang/SJLabel",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": {
        "SanJiang": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/changsanjiang/SJLabel.git",
        "tag": "v1.2.6.1"
    },
    "source_files": "SJLabel/*.{h,m}",
    "frameworks": [
        "UIKit",
        "CoreText"
    ],
    "requires_arc": true,
    "subspecs": [
        {
            "name": "Services",
            "source_files": "SJLabel/Services/*.{h,m}",
            "dependencies": {
                "SJLabel/Category": []
            }
        },
        {
            "name": "Category",
            "source_files": "SJLabel/Category/*.{h,m}"
        }
    ]
}

Pin It on Pinterest

Share This