スキル一覧に戻る
fusengine

swiftui-components

by fusengine

Redefining development through cognitive automation and collaborative agent systems.

0🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: swiftui-components description: Build production SwiftUI views, custom components, layouts, and view modifiers. Use when creating iOS/macOS UI components, implementing responsive layouts, building custom modifiers, or designing reusable view hierarchies with @ViewBuilder. user-invocable: false

SwiftUI Components & Views

Core Principles

  1. Small, focused views - Extract subviews at 30+ lines
  2. Composition over inheritance - Use ViewBuilder and modifiers
  3. Preview-driven development - Always include #Preview

View Structure Pattern

struct FeatureView: View {
    // MARK: - State
    @State private var isLoading = false

    // MARK: - Environment
    @Environment(\.dismiss) private var dismiss

    // MARK: - Body
    var body: some View {
        content
            .navigationTitle("Feature")
            .toolbar { toolbarContent }
    }

    // MARK: - Subviews
    @ViewBuilder
    private var content: some View {
        if isLoading {
            ProgressView()
        } else {
            mainContent
        }
    }
}

Custom Modifiers

struct CardModifier: ViewModifier {
    func body(content: Content) -> some View {
        content
            .padding()
            .background(.regularMaterial)
            .clipShape(RoundedRectangle(cornerRadius: 12))
            .shadow(radius: 4)
    }
}

extension View {
    func cardStyle() -> some View {
        modifier(CardModifier())
    }
}

Responsive Layouts

struct AdaptiveGrid: View {
    @Environment(\.horizontalSizeClass) var sizeClass

    var columns: [GridItem] {
        Array(repeating: GridItem(.flexible(), spacing: 16),
              count: sizeClass == .compact ? 2 : 4)
    }

    var body: some View {
        LazyVGrid(columns: columns, spacing: 16) {
            ForEach(items) { ItemCard(item: $0) }
        }
    }
}

Best Practices

  • Use @ViewBuilder for conditional content
  • Prefer some View return type
  • Extract magic numbers to constants
  • Use semantic colors: .primary, .secondary
  • Add .accessibilityLabel() to icons

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です