NSParagraphStyle+YYText.h 871 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // NSParagraphStyle+YYText.h
  3. // YYText <https://github.com/ibireme/YYText>
  4. //
  5. // Created by ibireme on 14/10/7.
  6. // Copyright (c) 2015 ibireme.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import <UIKit/UIKit.h>
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. Provides extensions for `NSParagraphStyle` to work with CoreText.
  15. */
  16. @interface NSParagraphStyle (YYText)
  17. /**
  18. Creates a new NSParagraphStyle object from the CoreText Style.
  19. @param CTStyle CoreText Paragraph Style.
  20. @return a new NSParagraphStyle
  21. */
  22. + (nullable NSParagraphStyle *)yy_styleWithCTStyle:(CTParagraphStyleRef)CTStyle;
  23. /**
  24. Creates and returns a CoreText Paragraph Style. (need call CFRelease() after used)
  25. */
  26. - (nullable CTParagraphStyleRef)yy_CTStyle CF_RETURNS_RETAINED;
  27. @end
  28. NS_ASSUME_NONNULL_END