simulates ios 12

This commit is contained in:
TrueZhuanjia
2025-06-07 18:25:45 +08:00
parent 68f21fa8e5
commit a64a29ce07
13 changed files with 42 additions and 42 deletions
@@ -738,7 +738,7 @@
// Set the label's frame with the calculated x-position
self.currentProfileLabel.frame = CGRectMake(profileLabelXPosition, self.currentProfileLabel.frame.origin.y, self.currentProfileLabel.frame.size.width, self.currentProfileLabel.frame.size.height);
self.currentProfileLabel.hidden = NO; // Show Current Profile display
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
self.currentProfileLabel.textAlignment = NSTextAlignmentNatural;
self.currentProfileLabel.numberOfLines = 2;
} else {
@@ -268,7 +268,7 @@ didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
NSMutableArray *profilesEncoded;
// 解码原始的NSArray对象,得到包含编码对象的数组
error = nil;
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
// 在 iOS 13 及以上使用 unarchivedObjectOfClasses
profilesEncoded = [NSKeyedUnarchiver unarchivedObjectOfClasses:classes fromData:fileData error:&error];
} else {
@@ -136,7 +136,7 @@ static NSMutableSet* hostList;
- (void)updateTitle {
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
navBarAppearanceScroll.titleTextAttributes = navBarAppearanceStandard.titleTextAttributes = @{
NSFontAttributeName: [UIFont systemFontOfSize:20 weight:UIFontWeightMedium],
NSForegroundColorAttributeName: [ThemeManager textColor] // 可选,设置标题颜色
@@ -151,7 +151,7 @@ static NSMutableSet* hostList;
self.title = [LocalizationHelper localizedStringForKey: @"Searching for PCs on your network..."] ;
}
else {
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
navBarAppearanceScroll.titleTextAttributes = navBarAppearanceStandard.titleTextAttributes = @{
NSFontAttributeName: [UIFont systemFontOfSize:24 weight:UIFontWeightSemibold],
NSForegroundColorAttributeName: [ThemeManager textColor] // 可选,设置标题颜色
@@ -165,7 +165,7 @@ static NSMutableSet* hostList;
self.title = [LocalizationHelper localizedStringForKey: @"Hosts" ];
//self.title = nil;
}
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[self applyNavBarAppearance];
} else {
// Fallback on earlier versions
@@ -1280,7 +1280,7 @@ static NSMutableSet* hostList;
// 设置图标(SF Symbol)
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:17 weight:UIImageSymbolWeightMedium];
UIImage *image = [UIImage systemImageNamed:@"plus.circle" withConfiguration:config];
[button setImage:image forState:UIControlStateNormal];
@@ -1320,7 +1320,7 @@ static NSMutableSet* hostList;
button.clipsToBounds = YES;
// 设置图标(SF Symbol)
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:buttonHeight*0.85 weight:UIImageSymbolWeightRegular];
UIImage *image = [UIImage systemImageNamed:@"questionmark.circle" withConfiguration:config];
[button setImage:image forState:UIControlStateNormal];
@@ -1380,7 +1380,7 @@ static NSMutableSet* hostList;
}
- (void)setupNavBar{
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
navBarAppearanceStandard = [[UINavigationBarAppearance alloc] init];
[navBarAppearanceStandard configureWithOpaqueBackground]; // 不透明
navBarAppearanceStandard.backgroundColor =[ThemeManager appBackgroundColor];; // 设置你需要的背景色
@@ -1419,7 +1419,7 @@ static NSMutableSet* hostList;
[_settingsButton setTarget:self.revealViewController];
[_settingsButton setAction:@selector(revealToggle:)];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[_settingsButton setTitle:nil];
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:23 weight:UIImageSymbolWeightMedium ];
UIImage *image = [[UIImage systemImageNamed:@"sidebar.left" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
@@ -911,7 +911,7 @@ const int FrontViewPositionNone = 0xff;
_dockedNavBar.translatesAutoresizingMaskIntoConstraints = NO;
_dockedNavBar.userInteractionEnabled = YES;
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UINavigationBarAppearance *navBarAppearanceStandard = [[UINavigationBarAppearance alloc] init];
[navBarAppearanceStandard configureWithOpaqueBackground]; // 不透明
navBarAppearanceStandard.backgroundColor =[ThemeManager appBackgroundColor];; // 设置你需要的背景色
@@ -961,7 +961,7 @@ const int FrontViewPositionNone = 0xff;
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] init];
[backButton setTarget:self];
[backButton setAction:@selector(foldRearView)];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[backButton setTitle:nil];
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:23 weight:UIImageSymbolWeightMedium ];
UIImage *image = [[UIImage systemImageNamed:@"sidebar.left" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
@@ -979,7 +979,7 @@ const int FrontViewPositionNone = 0xff;
_disconnectButton = [[UIBarButtonItem alloc] init];
[_disconnectButton setTarget:self];
[_disconnectButton setAction:@selector(disconnectRemoteSession)];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[_disconnectButton setTitle:nil];
UIImage *image = [[UIImage imageNamed:@"disconnect.svg" ] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
@@ -1002,7 +1002,7 @@ const int FrontViewPositionNone = 0xff;
if(!_moreButton) _moreButton = [[UIBarButtonItem alloc] init];
//[moreButton setAction:@selector(moreButtonTapped:)];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[_moreButton setTitle:nil];
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:23 weight:UIImageSymbolWeightMedium ];
UIImage *image = [[UIImage systemImageNamed:@"ellipsis.circle" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
@@ -1039,7 +1039,7 @@ const int FrontViewPositionNone = 0xff;
- (void)removeSettingItemSelected{
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
// UIAction* action1 = [self getAllSettingMenuAction];
UIAction* action1 = [self getDoneRemoveSettingAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1]];
@@ -1051,7 +1051,7 @@ const int FrontViewPositionNone = 0xff;
}
- (void)doneRemoveSettingItemSelected{
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UIAction* action1 = [self getAllSettingMenuAction];
UIAction* action2 = [self getRemoveSettingItemAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1, action2]];
@@ -1146,7 +1146,7 @@ const int FrontViewPositionNone = 0xff;
}
- (void)favoriteSettingSelected {
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UIAction* action1 = [self getAllSettingMenuAction];
UIAction* action2 = [self getRemoveSettingItemAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1, action2]];
@@ -1157,7 +1157,7 @@ const int FrontViewPositionNone = 0xff;
}
- (void)allSettingSelected {
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UIAction* action1 = [self getFavoriteMenuAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1]];
}
@@ -404,7 +404,7 @@ BOOL isCustomResolution(CGSize res) {
- (void)layoutSections{
MenuSectionView *videoSection = [[MenuSectionView alloc] init];
videoSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Video"];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[videoSection setSectionIcon:[UIImage systemImageNamed:@"airplayvideo"]];
} else [videoSection setSectionIcon:nil];
@@ -417,7 +417,7 @@ BOOL isCustomResolution(CGSize res) {
MenuSectionView *gesturesSection = [[MenuSectionView alloc] init];
gesturesSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Gestures"];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[gesturesSection setSectionIcon:[UIImage systemImageNamed:@"hand.draw"]];
} else [gesturesSection setSectionIcon:nil];
@@ -775,7 +775,7 @@ BOOL isCustomResolution(CGSize res) {
- (void)attachRemoveButtonForStack:(UIStackView* )stack{
UIButton* button = [UIButton buttonWithType:UIButtonTypeSystem];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:16 weight:UIImageSymbolWeightMedium];
[button setImage:[UIImage systemImageNamed:@"minus.circle" withConfiguration:config] forState:UIControlStateNormal];
} else {
@@ -796,7 +796,7 @@ BOOL isCustomResolution(CGSize res) {
- (void)attachInfoTagForStack:(UIStackView* )stack{
UIButton* button = [UIButton buttonWithType:UIButtonTypeSystem];
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:13.5 weight:UIImageSymbolWeightBold];
[button setImage:[UIImage systemImageNamed:@"info.circle" withConfiguration:config] forState:UIControlStateNormal];
} else {
@@ -1729,7 +1729,7 @@ BOOL isCustomResolution(CGSize res) {
for (UIView *subview in view.subviews) {
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
label.layer.filters = nil;
label.textColor = [ThemeManager textColor];
} else {
@@ -1744,7 +1744,7 @@ BOOL isCustomResolution(CGSize res) {
for (UIView *subview in view.subviews) {
if ([subview isKindOfClass:[UISegmentedControl class]]) {
UISegmentedControl *selector = (UISegmentedControl *)subview;
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
selector.selectedSegmentTintColor = [ThemeManager appSecondaryColor];
} else {
// Fallback on earlier versions
@@ -555,7 +555,7 @@
#if TARGET_OS_TV
[_overlayView setFont:[UIFont systemFontOfSize:24]];
#else
if (@available(iOS 13.0, *)) {
if (@available(iOS 13.0, *) && false) {
[_overlayView setFont:[UIFont monospacedSystemFontOfSize:12 weight:UIFontWeightRegular]];
} else {
[_overlayView setFont:[UIFont systemFontOfSize:12]];// Fallback on earlier versions