一个现代化的 iOS 越狱插件设置界面模板,采用毛玻璃卡片式设计。
- 🎨 毛玻璃效果 + 卡片式布局
- 🔍 设置项搜索功能
- 📂 可折叠分组
- 🎛️ 多种控件类型:开关、按钮、滑块、分段选择
- 💾 自动持久化存储 (NSUserDefaults)
KCMenu/
├── SettingsViewController.h/m # 核心设置界面
├── Tweak.xm # Hook 入口(抖音长按面板示例)
├── Makefile # Tweak 编译配置
└── TestApp/ # 独立测试 App
├── main.m
├── AppDelegate.h/m
├── MainViewController.h/m
├── Makefile
└── Resources/
- 复制
SettingsViewController.h/m到你的项目 - 在 Hook 中调用:
#import "SettingsViewController.h"
SettingsViewController *svc = [[SettingsViewController alloc] init];
svc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[viewController presentViewController:svc animated:YES completion:nil];cd TestApp
make package生成的 IPA 可通过 TrollStore / AltStore 安装测试。
修改 menuSections 数组:
self.menuSections = @[
@{@"title": @"分组名称", @"expanded": @NO, @"subitems": @[
@{@"title": @"开关项", @"detail": @"描述", @"type": @(SettingTypeSwitch), @"key": @"switch_key"},
@{@"title": @"滑块项", @"type": @(SettingTypeSlider), @"key": @"slider_key"},
@{@"title": @"按钮项", @"type": @(SettingTypeButton), @"key": @"button_key"},
@{@"title": @"分段项", @"type": @(SettingTypeSegmented), @"key": @"seg_key", @"options": @[@"A", @"B", @"C"]},
]}
];设置项类型:
| 类型 | 枚举值 | 说明 |
|---|---|---|
| 开关 | SettingTypeSwitch |
布尔值开关 |
| 按钮 | SettingTypeButton |
点击触发动作 |
| 滑块 | SettingTypeSlider |
数值调节 (0-100) |
| 分段 | SettingTypeSegmented |
多选一,需提供 options |
| 信息 | SettingTypeInfo |
纯展示,需提供 value |
- 图层 - UI 设计灵感来源
MIT