• Stars
    star
    142
  • Rank 258,495 (Top 6 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 me a star.

联系作者

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

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

Other

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

老司机的简书

其他

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

老司机的简书

More Repositories

1

-Tools

一些自己用的工具类
Objective-C
62
star
2

DWAnimation

给你一个优雅的方式生成动画
Objective-C
35
star
3

DWTableViewHelper

这是一个可以帮你快速创建列表视图的工具类。
Objective-C
35
star
4

DWSlideCaptchaView

这是一个可以帮你快速集成滑动验证功能的类。
Objective-C
33
star
5

DWEventBus

灵活的事件总线,支持弱类型及联合事件,观察者释放后自动移除订阅关系等。A flexible event bus who supports subType/unite event,and remove subscribe when the observer dealloced.
Objective-C
24
star
6

Learning-OpenGL

从零开始学习OpenGL
C
16
star
7

DWDatabase

模型自动落库工具类
Objective-C
15
star
8

DWLogger

这是一个日志助手类,他可以帮助你在App中直接查看输出的日志,同时不影响电脑端的日志输出。This is a Log Helper Class which enables you read logs in your App on screen directly and doesn't affect your logs on computer.
Objective-C
12
star
9

Components

常用控件封装
Objective-C
6
star
10

DWMediator

一个基于Protocol-Class方案的轻量级组件化中间件方案。
Objective-C
6
star
11

DWCheckBox

Objective-C
5
star
12

DWLyricLabel

帮你快速实现歌词展示
Objective-C
4
star
13

DWHUD

Objective-C
3
star
14

DWBanner-ColV-

A banner that your can use easily.
Objective-C
3
star
15

DWReader

为漫读小说写一个阅读器核心
Objective-C
2
star
16

DWGitTool

If you just need a subPath of a repository,just use me!
Shell
1
star
17

DWFlashFlow

网络请求库,核心基于AFN3.0,实现批量请求、链请求及依赖请求。Network request library, core based on AFN3.0, implements batch request, chain request and dependency request.
Objective-C
1
star