Communitygithub.com

SwiftUI UI 패턴

SwiftUI 뷰와 컴포넌트를 생성하거나 리팩토링할 때, TabView 아키텍처 디자인, 화면 구성, 컴포넌트별 패턴과 예제가 필요할 때 사용합니다.

SwiftUI UI 패턴란 무엇인가요?

이 스킬은 SwiftUI 기반 애플리케이션을 개발하거나 유지보수할 때 일관된 UI 패턴과 모범 사례를 적용할 수 있도록 안내합니다. 기존 프로젝트에서 특정 화면이나 기능을 추가/수정할 때는 저장소 내에서 유사한 예제를 찾고(`rg "TabView\("` 등 사용), 해당 프로젝트의 지역적 규칙(로컬 상태 유지, 환경 주입을 통한 의존성 공유 등)을 따르도록 도와줍니다. 새 프로젝트를 시작할 때는 `references/app-scaffolding-wiring.md`를 참고하여 TabView + NavigationStack + sheets를 설정하고, `AppTab` 및 `RouterPath` 뼈대를 추가하도록 안내합니다. 또한 `@State`, `@Binding`, `@Observable`, `@Environment` 같은 현대적인 SwiftUI 상태 방식을 사용하고, 뷰를 작고 집중된 하위 뷰로 분할하며, `.sheet(item:)`을 우선 사용하도록 권장합니다. 주요 플랫폼은 iOS/macOS/watchOS/tvOS 등 SwiftUI를 지원하는 모든 애플 플랫폼이며, Cursor, Claude Code, Codex 등 모든 AI 지원 코딩 도구에서 활용할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/dimillian/swiftui-ui-patterns

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

SwiftUI UI 패턴은(는) 무엇을 하나요?

빠른 시작

목표에 따라 경로를 선택하세요:

기존 프로젝트

  • 기능이나 화면 및 주요 상호작용 모델(목록, 상세, 편집기, 설정, 탭)을 식별합니다.
  • 저장소에서 rg "TabView\(" 등으로 유사한 예제를 찾고, 가장 가까운 SwiftUI 뷰를 읽습니다.
  • 지역적 규칙을 적용합니다: SwiftUI 네이티브 상태를 선호하고, 가능하면 상태를 로컬로 유지하며, 공유 의존성은 환경 주입을 사용합니다.
  • references/components-index.md에서 관련 컴포넌트 참조를 선택하고 그 지침을 따릅니다.
  • 작고 집중된 하위 뷰와 SwiftUI 네이티브 데이터 흐름으로 뷰를 구성합니다.

새로운 프로젝트 스캐폴딩

  • references/app-scaffolding-wiring.md부터 시작하여 TabView + NavigationStack + sheets를 연결합니다.
  • 제공된 뼈대를 기반으로 최소한의 AppTab과 RouterPath를 추가합니다.
  • 먼저 필요한 UI에 따라 다음 컴포넌트 참조(TabView, NavigationStack, Sheets)를 선택합니다.
  • 새 화면이 추가됨에 따라 경로 및 시트 열거형을 확장합니다.

따라야 할 일반 규칙

  • 최신 SwiftUI 상태(@State, @Binding, @Observable, @Environment)를 사용하고 불필요한 뷰 모델을 피합니다.
  • 컴포지션을 선호하고, 뷰를 작고 집중적으로 유지합니다.
  • .task와 함께 async/await를 사용하고 명시적인 로딩/오류 상태를 표시합니다.
  • 레거시 파일을 편집할 때만 기존 레거시 패턴을 유지합니다.
  • 프로젝트의 포맷터 및 스타일 가이드를 따릅니다.
  • 시트: 상태가 선택된 모델을 나타낼 때는 .sheet(isPresented:)보다 .sheet(item:)을 선호합니다. 시트 본문 내에서 if let을 사용하지 마십시오. 시트는 자체 작업을 소유하고 onCancel/onConfirm 클로저를 전달하는 대신 내부적으로 dismiss()를 호출해야 합니다.

새 SwiftUI 뷰를 위한 워크플로우

  1. 뷰의 상태와 소유권 위치를 정의합니다.
  2. @Environment를 통해 주입할 의존성을 식별합니다.
  3. 뷰 계층 구조를 스케치하고 반복되는 부분을 하위 뷰로 추출합니다.
  4. .task와 필요한 경우 명시적 상태 열거형을 사용하여 비동기 로딩을 구현합니다.
  5. UI가 상호작용할 때 접근성 레이블 또는 식별자를 추가합니다.
  6. 빌드로 검증하고 필요하면 호출 지점을 업데이트합니다.

컴포넌트 참조

references/components-index.md를 진입점으로 사용합니다. 각 컴포넌트 참조에는 다음이 포함되어야 합니다:

  • 의도 및 최적의 시나리오.
  • 지역적 규칙을 적용한 최소 사용 패턴.
  • 함정 및 성능 참고 사항.
  • 현재 저장소의 기존 예제 경로.

시트 패턴

항목 기반 시트 (선호)

@State private var selectedItem: Item?

.sheet(item: $selectedItem) { item in
    EditItemSheet(item: item)
}

시트가 자체 동작을 소유

struct EditItemSheet: View {
    @Environment(\.dismiss) private var dismiss
    @Environment(Store.self) private var store

    let item: Item
    @State private var isSaving = false

    var body: some View {
        VStack {
            Button(isSaving ? "저장 중…" : "저장") {
                Task { await save() }
            }
        }
    }

    private func save() async {
        isSaving = true
        await store.save(item)
        dismiss()
    }
}

새 컴포넌트 참조 추가

  • references/<component>.md를 생성합니다.
  • 짧고 실행 가능하게 유지하며, 현재 저장소의 구체적인 파일에 링크합니다.
  • references/components-index.md에 새 항목을 업데이트합니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬