一、Application调用的方法
//Application
//1屏幕方向
UIInterfaceOrientation interfaceOrientation=[UIApplication sharedApplication].statusBarOrientation;
if (interfaceOrientation == UIDeviceOrientationPortrait || interfaceOrientation == UIDeviceOrientationPortraitUpsideDown) {
//翻转为竖屏时
NSLog(@"竖屏");
}
else if (interfaceOrientation==UIDeviceOrientationLandscapeLeft || interfaceOrientation == UIDeviceOrientationLandscapeRight) {
//翻转为横屏时
NSLog(@"横屏");
}
//2主窗口
UIWindow * keyWidow = [UIApplication sharedApplication].keyWindow;
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(20, 80, 80, 40)];
[keyWidow addSubview:label];
二、currentDevice调用的方法
//currentDevice
//1版本名
NSString * versionName = [UIDevice currentDevice].systemName;
NSLog(@"versionName = %@",versionName);
//2版本号
CGFloat version = [[UIDevice currentDevice].systemVersion floatValue];
NSLog(@"version = %lf",version);
//3设备标识
NSString * identifierForVendor = [[UIDevice currentDevice].identifierForVendor UUIDString];
NSLog(@"identifierForVendor = %@",identifierForVendor);