Skip to content

Commit 550ac99

Browse files
author
DevelopLab
committed
1.Disable State Restoration
2.Change SettingsView UITableView style for iOS14
1 parent 72bf672 commit 550ac99

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
TARGET = iOS
22
ARCHS := arm64
33
TARGET = iphone:clang:latest:14.0
4+
5+
# TARGET = simulator:clang:latest:14.0
6+
# ARCHS = x86_64 arm64
7+
48
INSTALL_TARGET_PROCESSES = RebootTools
59

610
include $(THEOS)/makefiles/common.mk

Resources/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,7 @@
8383
<string>public.app-category.utilities</string>
8484
<key>CFBundleShortVersionString</key>
8585
<string>1.2</string>
86+
<key>UIApplicationStateRestoration</key>
87+
<false/>
8688
</dict>
8789
</plist>

SettingsViewController.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class SettingsViewController: UIViewController, UITableViewDelegate, UITableView
44

55
var onSettingsChanged: (() -> Void)? // 一个回调
66

7-
let tableView = UITableView(frame: .zero, style: .insetGrouped)
7+
var tableView = UITableView(frame: .zero, style: .insetGrouped)
88
private let settingsUtils = SettingsUtils.instance
99
private var hasRootPermission = false //用于存储是否是有Root权限
1010

@@ -42,6 +42,13 @@ class SettingsViewController: UIViewController, UITableViewDelegate, UITableView
4242
// 检查Root权限
4343
hasRootPermission = settingsUtils.checkInstallPermission()
4444

45+
// iOS 15 之后的版本使用新的UITableView样式
46+
if #available(iOS 15.0, *) {
47+
tableView = UITableView(frame: .zero, style: .insetGrouped)
48+
} else {
49+
tableView = UITableView(frame: .zero, style: .grouped)
50+
}
51+
4552
// 设置表格视图的代理和数据源
4653
tableView.delegate = self
4754
tableView.dataSource = self

0 commit comments

Comments
 (0)