+0
日增长
8,859
stars
1,846
forks
201
watchers
69
prs
952
issues
7
releases
README
YYText
==============
Powerful text framework for iOS to display and edit rich text.
(It's a component of YYKit)
Features
==============
- UILabel and UITextView API compatible
- High performance asynchronous text layout and rendering
- Extended CoreText attributes with more text effects
- Text attachments with UIImage, UIView and CALayer
- Custom highlight text range to allow user interact with
- Text parser support (built in markdown/emoticon parser)
- Text container path and exclusion paths support
- Vertical form layout support (for CJK text)
- Image and attributed text copy/paste support
- Attributed text placeholder support
- Custom keyboard view support
- Undo and redo control
- Attributed text archiver and unarchiver support
- Multi-language and VoiceOver support
- Interface Builder support
- Fully documented
Architecture
==============
YYText vs TextKit
Text Attributes
==============
YYText supported attributes
Demo
Attribute Name
Class
TextAttachment
YYTextAttachment
TextHighlight
YYTextHighlight
TextBinding
YYTextBinding
TextShadowTextInnerShadow
YYTextShadow
TextBorder
YYTextBorder
TextBackgroundBorder
YYTextBorder
TextBlockBorder
YYTextBorder
TextGlyphTransform
NSValue(CGAffineTransform)
TextUnderline
YYTextDecoration
TextStrickthrough
YYTextDecoration
TextBackedString
YYTextBackedString
CoreText attributes which is supported by YYText
Demo
Attribute Name
Class
Font
UIFont(CTFontRef)
Kern
NSNumber
StrokeWidth
NSNumber
StrokeColor
CGColorRef
Shadow
NSShadow
Ligature
NSNumber
VerticalGlyphForm
NSNumber(BOOL)
WritingDirection
NSArray(NSNumber)
RunDelegate
CTRunDelegateRef
TextAlignment
NSParagraphStyle (NSTextAlignment)
LineBreakMode
NSParagraphStyle (NSLineBreakMode)
LineSpacing
NSParagraphStyle (CGFloat)
ParagraphSpacing ParagraphSpacingBefore
NSParagraphStyle (CGFloat)
FirstLineHeadIndent
NSParagraphStyle (CGFloat)
HeadIndent
NSParagraphStyle (CGFloat)
TailIndent
NSParagraphStyle (CGFloat)
MinimumLineHeight
NSParagraphStyle (CGFloat)
Top issues
#89使用百度或者搜狗英文输入联想问题19 comments · 2015-12-18#938YYTextEffectWindow 的rootViewController方法死循环14 comments · 2020-09-24#529iOS10计算高度还是不对13 comments · 2016-10-11#331YYText作者您好,YYTextLayout固定最大宽度时,计算出来的尺寸有误,求助呀13 comments · 2016-05-23#773iOS11 纯中文时 上下居中会有偏差 YYTextVerticalAlignmentCenter12 comments · 2018-01-29#373YYTextLayout计算错误12 comments · 2016-06-14#350YYTextLayout crash11 comments · 2016-05-31#911可以进行iOS13黑暗模式适配吗11 comments · 2019-12-10
Latest release
Bug fixes 1.0.6 2016-09-13- iOS 7 compatible when set font name with InterfaceBuilder: 404 - iOS 10 compatible for text layout: 459 - Fix text border draw defect when the border is out of the view's bounds: 341 - Fix incorrect state when resize vertical form textview: 483 - Fix potential crash when get attribute from NSAttributedString with invalid index. - Fix Xcode8 warnings