← Back to Skills Marketplace
675
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install ios-view-generator
Description
从截图生成 Objective-C iOS 视图代码,支持懒加载模式和布局/数据分离。当用户需要:(1) 从截图生成 iOS UI 代码,(2) 生成 Objective-C 视图控制器或视图代码,(3) 创建遵循懒加载规范的 iOS 视图时触发此技能。
README (SKILL.md)
iOS View Generator
从截图生成规范的 Objective-C iOS 视图代码。
核心规范
代码结构
#pragma mark - Life Cycle // 生命周期
#pragma mark - UI // UI 创建
#pragma mark - Layout // 布局约束
#pragma mark - Data // 数据加载
#pragma mark - Event Response // 事件响应
#pragma mark - Lazy Load // 懒加载
三大原则
- 懒加载: 所有 UI 组件在 getter 中初始化
- 布局分离:
setupUI只负责 addSubView,setupConstraints负责约束 - 数据分离:
loadData负责请求,refreshUI负责绑定
生成流程
步骤 1: 分析截图
使用 image 工具分析用户提供的截图:
- 识别 UI 层级结构
- 提取控件类型、数量、位置
- 估算尺寸和间距
步骤 2: 声明属性
@interface MyViewController ()
@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) UILabel *titleLabel;
// ... 其他属性
@end
步骤 3: 实现懒加载
每个组件独立 getter:
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont boldSystemFontOfSize:18];
_titleLabel.textColor = [UIColor blackColor];
}
return _titleLabel;
}
步骤 4: UI 与布局分离
- (void)setupUI {
[self.view addSubview:self.containerView];
[self.containerView addSubview:self.titleLabel];
}
- (void)setupConstraints {
[self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view).insets(UIEdgeInsetsMake(20, 15, 20, 15));
}];
}
步骤 5: 数据加载
- (void)loadData {
// 网络请求或本地数据
}
- (void)refreshUI {
// 数据绑定到视图
self.titleLabel.text = self.dataModel.title;
}
参考文档
- 完整代码示例
- 常用 UI 组件初始化模板
- Masonry / 原生 Auto Layout 布局方式
注意事项
- 默认使用 Masonry 布局,若无则生成原生 Auto Layout
- 尺寸和间距使用估算值,用户可根据设计稿调整
- 颜色使用系统颜色 (systemBlueColor 等),便于适配暗色模式
- 图片资源使用占位符名称,用户需自行替换
Usage Guidance
该技能在内部是一致的:它会根据用户提供的截图本地生成 Objective-C 视图代码并以懒加载和布局/数据分离为规范。安装前请注意:
- 不要在截图中包含敏感信息(API 密钥、密码、个人隐私等),因为截图会被分析;技能文档未说明截图会被上传到第三方,但具体的图像处理实现由平台的 image 工具决定,若担心隐私请确认平台的图像处理/存储策略。
- 生成的代码使用 Masonry 为默认布局,若项目未使用该库需要自行在项目中引入(Podfile 修改);占位图片名与默认颜色需由你手动替换/调整。
- 自动生成代码只作为模板/加速器:务必人工审查以确保遵循你的工程结构、内存/生命周期管理(代理、弱引用等)、输入校验与安全策略。
总体而言,这个技能看起来是用于其声明目的且没有不成比例的权限要求。
Capability Analysis
Type: OpenClaw Skill
Name: ios-view-generator
Version: 1.0.0
The skill bundle 'ios-view-generator' is designed to generate Objective-C iOS view code from screenshots, following specific architectural patterns. All files contain documentation and code examples consistent with this stated purpose. There are no instructions for the AI agent to perform malicious actions such as data exfiltration, unauthorized command execution, or persistence. The mention of an 'image tool' in SKILL.md is a functional description of a task, not a malicious prompt injection attempt, and does not instruct the agent to execute commands in a vulnerable manner.
Capability Assessment
Purpose & Capability
技能名、描述和 SKILL.md 中的生成流程(识别截图、声明属性、实现懒加载、分离 UI/布局/数据)一致。没有要求与目的不符的环境变量、二进制或配置路径。
Instruction Scope
SKILL.md 明确限定在解析用户提供的截图并生成 Objective-C 视图代码,引用的操作(使用 image 工具分析截图、生成属性/懒加载/约束等)与技能目的对应,没有要求读取系统凭据或其他无关文件。
Install Mechanism
无安装规范(instruction-only),不会在宿主环境写入或下载第三方可执行文件,风险较低。
Credentials
不需要任何环境变量或凭据(primaryEnv 空),亦未声明访问其它服务的密钥,所需权限与功能匹配。
Persistence & Privilege
没有设置 always:true,也不请求修改其它技能或系统配置;默认的自主调用权限为平台行为,与技能内容无冲突。
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install ios-view-generator - After installation, invoke the skill by name or use
/ios-view-generator - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
ios-view-generator v1.0.0
- Initial release.
- Generate Objective-C iOS view/controller code from screenshots.
- Supports lazy loading for all UI components.
- Separates UI creation, layout constraints, and data binding.
- Uses Masonry by default for Auto Layout; falls back to native if unavailable.
- Provides estimated sizing, spacing, and system colors for better adaptability.
Metadata
Frequently Asked Questions
What is 生成iOS视图UI?
从截图生成 Objective-C iOS 视图代码,支持懒加载模式和布局/数据分离。当用户需要:(1) 从截图生成 iOS UI 代码,(2) 生成 Objective-C 视图控制器或视图代码,(3) 创建遵循懒加载规范的 iOS 视图时触发此技能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 675 downloads so far.
How do I install 生成iOS视图UI?
Run "/install ios-view-generator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is 生成iOS视图UI free?
Yes, 生成iOS视图UI is completely free (open-source). You can download, install and use it at no cost.
Which platforms does 生成iOS视图UI support?
生成iOS视图UI is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created 生成iOS视图UI?
It is built and maintained by near2sea (@near2sea); the current version is v1.0.0.
More Skills