UIPasteboard+YYText.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // UIPasteboard+YYText.h
  3. // YYText <https://github.com/ibireme/YYText>
  4. //
  5. // Created by ibireme on 15/4/2.
  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. Extend UIPasteboard to support image and attributed string.
  15. */
  16. @interface UIPasteboard (YYText)
  17. @property (nullable, nonatomic, copy) NSData *yy_PNGData; ///< PNG file data
  18. @property (nullable, nonatomic, copy) NSData *yy_JPEGData; ///< JPEG file data
  19. @property (nullable, nonatomic, copy) NSData *yy_GIFData; ///< GIF file data
  20. @property (nullable, nonatomic, copy) NSData *yy_WEBPData; ///< WebP file data
  21. @property (nullable, nonatomic, copy) NSData *yy_ImageData; ///< image file data
  22. /// Attributed string,
  23. /// Set this attributed will also set the string property which is copy from the attributed string.
  24. /// If the attributed string contains one or more image, it will also set the `images` property.
  25. @property (nullable, nonatomic, copy) NSAttributedString *yy_AttributedString;
  26. @end
  27. /// The name identifying the attributed string in pasteboard.
  28. UIKIT_EXTERN NSString *const YYTextPasteboardTypeAttributedString;
  29. /// The UTI Type identifying WebP data in pasteboard.
  30. UIKIT_EXTERN NSString *const YYTextUTTypeWEBP;
  31. NS_ASSUME_NONNULL_END