Agent Skills
› cosmicstack-labs/mercury-agent-skills
› ios-swift-patterns
ios-swift-patterns
GitHub提供iOS Swift开发的生产级模式指南,涵盖MVVM与Coordinator架构、SwiftUI性能优化、状态管理及App Store提交清单。
Trigger Scenarios
询问iOS应用架构设计
SwiftUI性能优化建议
App Store上架检查项
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill ios-swift-patterns -g -y
SKILL.md
Frontmatter
{
"name": "ios-swift-patterns",
"metadata": {
"tags": [
"ios",
"swift",
"swiftui",
"uikit",
"mobile",
"apple"
],
"author": "cosmicstack-labs",
"version": "1.0.0",
"category": "mobile"
},
"description": "SwiftUI, UIKit, MVVM, Combine, async\/await, Core Data, and App Store submission patterns"
}
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:
@Publishedproperties,@Stateonly 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/LazyHStackfor large lists, notVStack - Mark views with
@MainActorexplicitly - Use
equatable()on complex views to prevent unnecessary re-renders - Prefer
@Statefor local,@StateObjectfor owned,@ObservedObjectfor 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
Version History
- 38e2523 Current 2026-07-05 19:40


