V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kingzwt
V2EX  ›  iPhone

自定义表情、Emotion、URL&PhoneNumber (LinkLabel、RichLabel)

  •  
  •   kingzwt · 2015-03-10 10:54:23 +08:00 · 4402 次点击
    这是一个创建于 3345 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://github.com/Joywii/RichLabel

    <img align="center" src="http://img.itc.cn/photo/jmdOyY5PIQV" alt="ScreenShot" width="300">

    说明

    RickLabel是UILabel的子类。支持显示表情、识别URL、电话号码等(可扩展),URL和电话号码可以点击可以长按。表情部分使用TextKit框架实现。识别URL、电话号码主要参考KILabel

    使用条件

    • ARC
    • iOS 7.0+

    如何使用

    1. 下载KZRichLabel,把KZRichLabel.h和KZRichLabel.m文件添加到工程中。
    2. 在需要的地方 #import "MZTimerLabel.h"(具体参考Demo)

    TODO

    1. Swift版本。
    2. 替换系统自带的URL识别和电话号码识别,改成精准的正则表达式。

    参考链接

    1. KILabel
    2. CCHLinkTextView
    3. STTweetLabel
    4. NimbusAttributedLabel

    License

    This code is distributed under the terms and conditions of the [MIT license](LICENSE).

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1222 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:11 · PVG 02:11 · LAX 11:11 · JFK 14:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.