# BSText(The Swift Version of YYText)
[](https://raw.githubusercontent.com/a1049145827/BSText/master/LICENSE)
[](https://github.com/Carthage/Carthage)
[](https://cocoapods.org/pods/BSText)
[](http://cocoadocs.org/docsets/BSText)
[](https://www.apple.com/nl/ios/)
[](https://travis-ci.org/a1049145827/BSText)

Powerful text framework for iOS to display and edit rich text (the prefix 'BS' is come from BlueSky, The BlueSky Studio who created films named "Ice Age", Here is The cute squirrel.).
# 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
- Fully documented
# Architecture
All Same as [YYText](https://github.com/ibireme/YYText)
# Text Attributes
### BSText supported attributes
Demo | Attribute Name | Class |
---|---|---|
![]() |
TextAttachment | TextAttachment |
![]() |
TextHighlight | TextHighlight |
![]() |
TextBinding | TextBinding |
![]() |
TextShadow TextInnerShadow |
TextShadow |
![]() |
TextBorder | TextBorder |
![]() |
TextBackgroundBorder | TextBorder |
![]() |
TextBlockBorder | TextBorder |
![]() |
TextGlyphTransform | NSValue(CGAffineTransform) |
![]() |
TextUnderline | TextDecoration |
![]() |
TextStrickthrough | TextDecoration |
![]() |
TextBackedString | TextBackedString |
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) |
![]() |
MaximumLineHeight | NSParagraphStyle (CGFloat) |
![]() |
LineHeightMultiple | NSParagraphStyle (CGFloat) |
![]() |
BaseWritingDirection | NSParagraphStyle (NSWritingDirection) |
![]() |
DefaultTabInterval TabStops |
NSParagraphStyle CGFloat/NSArray(NSTextTab) |
Demo | Attribute Name | Class |
---|---|---|
![]() |
TextAttachment | TextAttachment |
![]() |
TextHighlight | TextHighlight |
![]() |
TextBinding | TextBinding |
![]() |
TextShadow TextInnerShadow |
TextShadow |
![]() |
TextBorder | TextBorder |
![]() |
TextBackgroundBorder | TextBorder |
![]() |
TextBlockBorder | TextBorder |
![]() |
TextGlyphTransform | NSValue(CGAffineTransform) |
![]() |
TextUnderline | TextDecoration |
![]() |
TextStrickthrough | TextDecoration |
![]() |
TextBackedString | TextBackedString |
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) |
![]() |
MaximumLineHeight | NSParagraphStyle (CGFloat) |
![]() |
LineHeightMultiple | NSParagraphStyle (CGFloat) |
![]() |
BaseWritingDirection | NSParagraphStyle (NSWritingDirection) |
![]() |
DefaultTabInterval TabStops |
NSParagraphStyle CGFloat/NSArray(NSTextTab) |