From 2aa126ced36d86b887e2692c20494141a08a1122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9D=E5=8F=91=E5=86=AC?= Date: Fri, 14 Oct 2022 10:37:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E6=A8=AA=E7=AB=96?= =?UTF-8?q?=E5=B1=8F=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ifish.xcodeproj/project.pbxproj | 2 ++ Ifish/Utinitys/Define.h | 12 +++---- .../IfishP2PMonitorController.m | 31 +++++++++++++++++-- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index ba955c9..c852a19 100644 --- a/Ifish.xcodeproj/project.pbxproj +++ b/Ifish.xcodeproj/project.pbxproj @@ -16061,6 +16061,7 @@ GCC_PREFIX_HEADER = "Ifish/Ifish-Prefix.pch"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Ifish/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -16180,6 +16181,7 @@ GCC_PREFIX_HEADER = "Ifish/Ifish-Prefix.pch"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Ifish/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( diff --git a/Ifish/Utinitys/Define.h b/Ifish/Utinitys/Define.h index 3417f26..c307936 100644 --- a/Ifish/Utinitys/Define.h +++ b/Ifish/Utinitys/Define.h @@ -144,13 +144,13 @@ alpha:1.0] static NSString* DOMAIN_NAME =@"app.ifish7.cn"; //正式环境 -//#define SOCKETPORT [Define sharedDefine].server -//#define JIEKOUPORT [[Define sharedDefine] getRealSever] -//#define JIEKOUPORTHTTP [[Define sharedDefine] getRealSever] +#define SOCKETPORT [Define sharedDefine].server +#define JIEKOUPORT [[Define sharedDefine] getRealSever] +#define JIEKOUPORTHTTP [[Define sharedDefine] getRealSever] //测试环境 -#define SOCKETPORT @"139.196.24.156" -#define JIEKOUPORT @"http://139.196.24.156:7080" -#define JIEKOUPORTHTTP @"https://app.ifish7.com" +//#define SOCKETPORT @"139.196.24.156" +//#define JIEKOUPORT @"http://139.196.24.156:7080" +//#define JIEKOUPORTHTTP @"https://app.ifish7.com" //云 @"https://app.ifish7.com" //云图片头像等地址 @"http://app.ifish7.com" //#define JIEKOUPORTHTTP @"https://app.ifish7.com" diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index bb0bc1a..4fb6304 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -1289,9 +1289,22 @@ Strong UIImage *screenShotImage;//截图 //设置横屏 [AppDelegate sharedDefault].canFullScreen = YES; static int isFullScreen = 3; // 3 == 全屏 1 == 竖屏 - if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) + if (@available(iOS 16.0, *)) { + [self setNeedsUpdateOfSupportedInterfaceOrientations]; + [self.navigationController setNeedsUpdateOfSupportedInterfaceOrientations]; + + NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects]; + UIWindowScene *scene = (UIWindowScene *)array[0]; + UIWindowSceneGeometryPreferencesIOS *geometryPreferences = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:UIInterfaceOrientationMaskLandscape]; + [scene requestGeometryUpdateWithPreferences:geometryPreferences + errorHandler:^(NSError * _Nonnull error) { + NSLog(@"wuwuFQ:%@", error); + }]; + + } else if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { NSNumber *numb=[NSNumber numberWithInteger:UIInterfaceOrientationLandscapeRight]; + isFullScreen = UIInterfaceOrientationLandscapeRight; [[UIDevice currentDevice] performSelector:@selector(setOrientation:) withObject:numb]; @@ -1327,11 +1340,23 @@ Strong UIImage *screenShotImage;//截图 //设置竖屏 [AppDelegate sharedDefault].canFullScreen = NO; static int isFullScreen = 1; // 3 == 全屏 1 == 竖屏 - if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) + if (@available(iOS 16.0, *)) { + [self setNeedsUpdateOfSupportedInterfaceOrientations]; + [self.navigationController setNeedsUpdateOfSupportedInterfaceOrientations]; + + NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects]; + UIWindowScene *scene = (UIWindowScene *)array[0]; + UIWindowSceneGeometryPreferencesIOS *geometryPreferences = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:UIInterfaceOrientationMaskPortrait]; + [scene requestGeometryUpdateWithPreferences:geometryPreferences + errorHandler:^(NSError * _Nonnull error) { + NSLog(@"wuwuFQ:%@", error); + }]; + + } else if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { NSLog(@"self.interfaceOrientation%ld",(long)UIDeviceOrientationPortrait); - + isFullScreen = UIDeviceOrientationPortrait; //NSNumber *numb=[NSNumber numberWithInteger:UIDeviceOrientationPortrait]; //[[UIDevice currentDevice] performSelector:@selector(setOrientation:) // withObject:numb];