mcpbeat

Ios Swift Patterns

cosmicstack-labs/ios-swift-patterns

SwiftUI, UIKit, MVVM, Combine, async/await, Core Data, and App Store submission patterns

447 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
365
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill ios-swift-patterns

The instruction itself

8 sections, as written by the author

iOS Swift Patterns

Production-grade iOS development with Swift, SwiftUI, and UIKit.

Architecture

MVVM + Coordinator Pattern

View (SwiftUI/UIViewController)
  ↕ binds to
ViewModel (ObservableObject)
  ↕ calls
Service Layer (Networking, DB)
  ↕
Core Data / API

Key Principles

  • Views are dumb: They render state and forward actions — no business logic
  • ViewModels own state: @Published properties, @State only for local UI
  • Services are stateless: Network calls, DB operations, analytics
  • Coordinators handle navigation: Removing navigation from views makes them reusable

SwiftUI Best Practices

Performance

  • Use LazyVStack/LazyHStack for large lists, not VStack
  • Mark views with @MainActor explicitly
  • Use equatable() on complex views to prevent unnecessary re-renders
  • Prefer @State for local, @StateObject for owned, @ObservedObject for passed-in

State Management

// Good: Clear separation
@MainActor
class UserViewModel: ObservableObject {
    @Published var users: [User] = []
    @Published var isLoading = false

    func loadUsers() async {
        isLoading = true
        users = await userService.fetchUsers()
        isLoading = false
    }
}

App Store Submission Checklist

  • [ ] No Hardcoded API keys
  • [ ] TestFlight beta tested with real users
  • [ ] Privacy manifest updated
  • [ ] Screenshots for all required sizes
  • [ ] App Store description and keywords ready
  • [ ] Subscription/IAP products configured

How to use it

Copy the folder

Take cosmicstack-labs/ios-swift-patterns from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.