Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.27 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.27 KB

JX_RichTextRenderer

Rich text renderer implemented by CoreText.

Usage

  1. Add the source files JX_RichTextRenderer.h and JX_RichTextRenderer.m to your Xcode project.
  2. Import JX_RichTextRenderer.h .
  3. Create a JX_RichTextRenderer instance:
JX_RichTextRenderer *richTextRenderer = [[JX_RichTextRenderer alloc] initWithAttributedText:attributedString
                                                                                constraintSize:CGSizeMake(200, CGFLOAT_MAX)
                                                                                        insets:UIEdgeInsetsZero
                                                                                     lineSpace:0];
  1. Get content size:
CGSize contentSize = richTextRenderer.contentSize;
  1. Get content image:
UIImage *richTextImage = [richTextRenderer render];
  1. Use the image as you want.

You can add or remove functions as you need.

Requirements

This component requires iOS 8.0+.

License

JX_RichTextRenderer is provided under the MIT license. See LICENSE file for details.