TIMRTLUtil.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // TIMRTLUtil.h
  3. // TIMCommon
  4. //
  5. // Created by cologne on 2023/7/21.
  6. // Copyright © 2023 Tencent. All rights reserved
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface TIMRTLUtil : NSObject
  11. @end
  12. @interface UIView (TUIRTL)
  13. - (void)resetFrameToFitRTL;
  14. @end
  15. @interface UIImage (TUIRTL)
  16. - (UIImage *_Nonnull)checkOverturn;
  17. - (UIImage *)rtl_imageFlippedForRightToLeftLayoutDirection;
  18. @end
  19. typedef NS_ENUM(NSUInteger, TUITextRTLAlignment) {
  20. TUITextRTLAlignmentUndefine,
  21. TUITextRTLAlignmentLeading,
  22. TUITextRTLAlignmentTrailing,
  23. TUITextRTLAlignmentCenter,
  24. };
  25. @interface UILabel (TUIRTL)
  26. @property (nonatomic, assign) TUITextRTLAlignment rtlAlignment;
  27. @end
  28. @interface NSMutableAttributedString (TUIRTL)
  29. @property (nonatomic, assign) TUITextRTLAlignment rtlAlignment;
  30. @end
  31. BOOL isRTLString(NSString *string);
  32. NSString * rtlString(NSString *string);
  33. NSAttributedString *rtlAttributeString(NSAttributedString *attributeString ,NSTextAlignment textAlignment );
  34. UIEdgeInsets rtlEdgeInsetsWithInsets(UIEdgeInsets insets);
  35. @interface TUICollectionRTLFitFlowLayout : UICollectionViewFlowLayout
  36. @end
  37. NS_ASSUME_NONNULL_END