CustomEngine 自定义管理类
使用 CocoaPods 导入 pod 'CustomEngine'
DeviceEngine.framework IOS设备管理类 包含CustomDevice单例类
以下三种方式任选其一导入头文件
#import <DeviceEngine/DeviceEngine.h>
#import <DeviceEngine/CustomDevice.h>
@import DeviceEngine.CustomDevice
CustomDevice是一个单例类
- 在 AppDelegate 中设置 App 定向样式
- iOS 13 以下:在 '- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions' 方法中设置 App 定向样式
- iOS 13 以上:在 '- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options API_AVAILABLE(ios(13.0))' 方法中设置 App 定向样式
[CustomDevice defaultCustomDevice]
[CustomDevice defaultCustomDeviceOrientationStyle:<#CustomDeviceOrientationStyle#>];
CustomDevice单例类
- 设备类型判断:
- (BOOL)isSimulator 是否是模拟器
- (BOOL)isiPhone 是否是手机
等等
- 真机类型判断
- iPhone 类型:
- (BOOL)iPhone4S
- (BOOL)iPhone11ProMax
等等
- iPodTouch 类型:
- (BOOL)iPodTouch3
- (BOOL)iPodTouch7
等等
- iPad 类型:
- (BOOL)iPadMini5
- (BOOL)iPadPro129_3
等等
- iPhone 类型:
- 开发尺寸类型判断
支持真机、模拟器
- iPhone 类型:
- (BOOL)iPhone_320_480
- (BOOL)iPhone_414_896
等等
- iPad 类型:
- (BOOL)ipad_768_1024
- (BOOL)ipad_1024_1136
等等
- iPhone 类型:
- 其他类型判断:
- (CGFloat)deviceNavigationBarHeight
- (CGFloat)deviceSafeAreaBottomHeight
等等
CustomDevice 更多详情 DeviceEngine.md