This commit is contained in:
DDIsFriend
2023-08-18 17:28:57 +08:00
commit f0e8a1709d
4282 changed files with 192396 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
//
// RTLManager.h
// JXCategoryView
//
// Created by jiaxin on 2020/7/3.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface RTLManager : NSObject
+ (BOOL)supportRTL;
+ (void)horizontalFlipView:(UIView *)view;
+ (void)horizontalFlipViewIfNeeded:(UIView *)view;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// RTLManager.m
// JXCategoryView
//
// Created by jiaxin on 2020/7/3.
//
#import "RTLManager.h"
@implementation RTLManager
+ (BOOL)supportRTL {
return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:UIView.appearance.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
}
+ (void)horizontalFlipView:(UIView *)view {
view.transform = CGAffineTransformMakeScale(-1, 1);
}
+ (void)horizontalFlipViewIfNeeded:(UIView *)view {
if ([self supportRTL]) {
[self horizontalFlipView:view];
}
}
@end