Latest 1.2.3
Homepage https://github.com/CodeWicky/DWCoreTextLabel
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

DWCoreTextLabel

DWCoreTextLabel

Description

This is an object which is based on CoreText and a subclass of UIView.It provides all dayly function of UILabel,and also enable collocation of illustration and character、click-action and other extense function at the same time.

描述

这是一个基于CoreText、继承自UIView的控件。它是一个可以满足UILabel所有日常功能并提供图文混排、点击事件等扩展功能的控件。

Func

  • Insert image into a piece of text.
  • Draw image with text cover or around it.
  • Select a piece of text an copy it to pasteboard.
  • Add action to a piece of text or image.

功能

  • 向一段文本中插入图片。
  • 绘制图片并在其上绘制文字或者环绕着图片绘制文字。
  • 选中一段文字并复制到剪贴板。
  • 为一段文字或图片添加点击事件。

Usage

Firstly,drag it into your project or use cocoapods.

pod 'DWCoreTextLabel'

Then,to make you use it easily,I keep all the property the same as UILabel.So,use it as UILabel and other extense function you may understand its meaning by name.

And here are some API about image:

To insert image by using the series API of dw_InsertImage…

To draw image by using the series API of dw_DrawImage…

To add click-action by using dw_AddTarget…

To delete image by using dw_RemoveImageByID…

如何使用

首先,你应该将所需文件拖入工程中,或者你也可以用Cocoapods去集成他。

pod 'DWCoreTextLabel'

为了让开发者能够更快上手,我保留了与UILabel相同的属性名。所以你可以像使用UILabel一样使用它,并且一些拓展属性也是见名知意的,看他的属性名你大概就该知道他的用途。

还有一些图片相关的API:

使用dw_InsertImage…系列API向文字中插入图片。

使用dw_DrawImage…系列API在文字间绘制图片。

使用dw_AddTarget…API为文字或图片添加点击事件。

使用dw_RemoveImageByID…API为删除已经插入或绘制的图片。

Contact With Me

You may issue me on my Github or send me a email at [[email protected]]() to tell me some advices or the bug,I will be so appreciated.

If you like it please give a star.

联系作者

你可以通过在我的Github上给我留言或者给我发送电子邮件[[email protected]]()来给我提一些建议或者指出我的bug,我将不胜感激。

如果你喜欢这个小东西,记得给我一个star吧,么么哒~

Other

If you want to learn something about CoreText,you may come to my Blog.

老司机的简书

其他

如果你想学习一些CoreText的相关知识,你可以来老司机的博客

老司机的简书

Latest podspec

{
    "name": "DWCoreTextLabel",
    "version": "1.2.3",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "It is a Label based on coreText,help you to layout of the collocation of illustration and character.u57fau4e8ecoreTextu7684Labelu63a7u4ef6uff0cu5e2eu52a9u4f60u505au56feu6587u6df7u6392u3002",
    "homepage": "https://github.com/CodeWicky/DWCoreTextLabel",
    "authors": {
        "codeWicky": "[email protected]"
    },
    "social_media_url": "http://www.jianshu.com/u/a56ec10f6603",
    "source": {
        "git": "https://github.com/CodeWicky/DWCoreTextLabel.git",
        "tag": "1.2.3"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "DWCoreTextLabel/*.{h,m}",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This