Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计未展示

swiftui-programming-skillSwiftUI 编程技巧

Agent Skill

swiftui-programming-skill 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

19,750

周安装

784

GitHub Stars

公开资料未说明

下载量

5,525
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:swiftui-programming-skill(SwiftUI 编程技巧)
来源仓库:https://github.com/pstuart/pstuart
仓库路径:skills/swiftui-programming-skill
安装命令:
npx skills add pstuart/pstuart --skill "swiftui-programming-skill"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add pstuart/pstuart --skill "swiftui-programming-skill"

简介

用于查找、检索和筛选相关信息,支持基于关键词快速定位候选结果。

  • 适用于 Codex、Claude、Cursor 和 Gemini CLI 中的研究检索场景。
  • 可结合来源仓库 README 核验具体用法和功能边界。
  • 安装前需确认权限范围和维护状态,避免触发不必要的联网操作。
  • 建议评估是否会执行命令或读写文件后再部署使用。

SKILL.md

name
SwiftUI Programming Skill
description
Expertise in SwiftUI for building declarative user interfaces, including SF Symbols integration and best practices.
version
1.0
activation
Activate for queries on SwiftUI development, declarative UI building, SF Symbols usage, or SwiftUI component creation.

SwiftUI Programming Skill

This skill provides comprehensive guidance on developing user interfaces using SwiftUI, Apple's modern framework for building apps across all Apple platforms. It emphasizes declarative programming, state management, and integration with system features like SF Symbols.

Best Practices

  1. Declarative Syntax: Use SwiftUI's declarative approach to describe what the UI should look like, not how to build it.
  1. State Management: Leverage @State, @ObservedObject, @EnvironmentObject for managing view state.
  1. Composition: Build complex views by composing simpler views.
  1. Accessibility: Always consider accessibility features from the start.
  1. Performance: Use appropriate modifiers and avoid unnecessary view updates.
  1. SF Symbols: Utilize Apple's symbol library for consistent iconography.

SwiftUI Guidelines

  • Prefer built-in components over custom implementations when possible.
  • Use SwiftUI's layout system (HStack, VStack, ZStack) effectively.
  • Implement dark mode support automatically with Color and system colors.
  • Handle orientation changes gracefully.
  • Use @AppStorage for simple user preferences.

Examples

Example 1: Basic View with Toolbar

User Prompt: "Create a SwiftUI view with a navigation bar and toolbar items using SF Symbols."

Expected Output:

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
            Text("Hello, World!")
                .navigationTitle("My App")
                .toolbar {
                    ToolbarItem(placement: .navigationBarLeading) {
                        Button(action: {
                            // Action for leading button
                        }) {
                            Image(systemName: "line.horizontal.3")
                        }
                    }
                    ToolbarItem(placement: .navigationBarTrailing) {
                        Button(action: {
                            // Action for trailing button
                        }) {
                            Image(systemName: "plus")
                        }
                    }
                }
        }
    }
}

Example 2: State Management with @State

User Prompt: "Show how to create a toggle button that changes the background color using SwiftUI."

Expected Output:

import SwiftUI

struct ToggleView: View {
    @State private var isOn = false
    
    var body: some View {
        ZStack {
            (isOn ? Color.blue : Color.gray)
                .edgesIgnoringSafeArea(.all)
            
            VStack {
                Text(isOn ? "Light Mode" : "Dark Mode")
                    .foregroundColor(.white)
                    .font(.largeTitle)
                
                Toggle("Toggle Mode", isOn: $isOn)
                    .padding()
                    .toggleStyle(SwitchToggleStyle(tint: .white))
            }
        }
    }
}

Example 3: Using SF Symbols with Custom Styling

User Prompt: "How can I display an SF Symbol with custom colors and effects in SwiftUI?"

Expected Output:

import SwiftUI

struct SymbolView: View {
    var body: some View {
        VStack(spacing: 20) {
            Image(systemName: "star.fill")
                .font(.system(size: 50))
                .foregroundColor(.yellow)
            
            Image(systemName: "heart.fill")
                .font(.system(size: 50))
                .foregroundColor(.red)
                .shadow(radius: 5)
            
            Image(systemName: "moon.fill")
                .font(.system(size: 50))
                .foregroundColor(.blue)
                .background(Circle().fill(Color.white).shadow(radius: 3))
                .clipShape(Circle())
        }
    }
}

Example 4: List with Navigation

User Prompt: "Generate a SwiftUI list that navigates to detail views."

Expected Output:

import SwiftUI

struct Item: Identifiable {
    let id = UUID()
    let name: String
}

struct ListView: View {
    let items = [Item(name: "Item 1"), Item(name: "Item 2"), Item(name: "Item 3")]
    
    var body: some View {
        NavigationView {
            List(items) { item in
                NavigationLink(destination: DetailView(item: item)) {
                    Text(item.name)
                }
            }
            .navigationTitle("Items")
        }
    }
}

struct DetailView: View {
    let item: Item
    
    var body: some View {
        Text("Detail for \(item.name)")
            .navigationTitle(item.name)
    }
}

Example 5: Form with Validation

User Prompt: "Create a SwiftUI form for user input with basic validation."

Expected Output:

import SwiftUI

struct FormView: View {
    @State private var name = ""
    @State private var email = ""
    @State private var isValid = false
    
    var body: some View {
        NavigationView {
            Form {
                Section(header: Text("Personal Information")) {
                    TextField("Name", text: $name)
                    TextField("Email", text: $email)
                        .keyboardType(.emailAddress)
                        .autocapitalization(.none)
                }
                
                Section {
                    Button("Submit") {
                        // Submit action
                    }
                    .disabled(!isValid)
                }
            }
            .navigationTitle("User Form")
            .onChange(of: name) { _ in validateForm() }
            .onChange(of: email) { _ in validateForm() }
        }
    }
    
    private func validateForm() {
        isValid = !name.isEmpty && email.contains("@")
    }
}

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

windsurf

27.07%
按下载量换算1,496

Codex

24.28%
按下载量换算1,341

Claude Code

18.06%
按下载量换算998

Antigravity

12.82%
按下载量换算708

Gemini CLI

8.36%
按下载量换算462

trae

3.68%
按下载量换算203

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills