Skip to content

Joeyqiushi/JX_RichTextRenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Rich text renderer implemented by CoreText.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published