| name | ios-development |
| description | iOS開発のベストプラクティス、設計パターン、実装テクニック、よくあるトラブルと解決方法を包括的にカバー。MVVM、Clean Architecture、Combine、SwiftUI/UIKitの実践的なガイドを提供します。 |
iOS Development Skill
📋 目次
概要
このSkillは、iOS開発における全ての側面をカバーします:
- ✅ アーキテクチャパターン(MVVM, Clean Architecture, VIPER)
- ✅ SwiftUI/UIKit開発
- ✅ Reactive Programming(Combine, RxSwift)
- ✅ データ永続化(CoreData, Realm, UserDefaults)
- ✅ ネットワーク通信
- ✅ 非同期処理(async/await, DispatchQueue)
- ✅ Dependency Injection
- ✅ エラーハンドリング
- ✅ メモリ管理
- ✅ よくあるトラブルと解決方法
いつ使うか
自動的に参照されるケース
- 新しいiOSプロジェクトを開始する時
- 既存コードをリファクタリングする時
- アーキテクチャの選択・設計をする時
- 実装で迷った時
- エラーやクラッシュが発生した時
手動で参照すべきケース
- プロジェクトのアーキテクチャを決定する時
- 新しい機能の設計をする時
- パフォーマンス問題を調査する時
- チームメンバーへの教育時
アーキテクチャパターン
パターンの選択
| パターン | 適用ケース | 詳細ガイド |
|---|---|---|
| MVVM | 中小規模、SwiftUI | guides/01-mvvm-pattern.md |
| Clean Architecture | 大規模、テスタビリティ重視 | guides/02-clean-architecture.md |
| VIPER | 超大規模、チーム開発 | guides/03-viper-pattern.md |
| Coordinator | ナビゲーション複雑 | guides/04-coordinator-pattern.md |
詳細: guides/00-architecture-overview.md
UI開発
SwiftUI vs UIKit
| 観点 | SwiftUI | UIKit |
|---|---|---|
| 学習曲線 | 緩やか | 急 |
| iOS最低バージョン | iOS 13+ | iOS 2+ |
| カスタマイズ性 | 制限あり | 完全 |
| 推奨ケース | 新規プロジェクト | レガシー、細かい制御 |
SwiftUI開発
- guides/05-swiftui-fundamentals.md
- guides/06-swiftui-state-management.md
- guides/07-swiftui-animations.md
UIKit開発
データ管理
データ永続化の選択
| 技術 | 用途 | ガイド |
|---|---|---|
| UserDefaults | 設定、小さなデータ | guides/11-userdefaults.md |
| Keychain | 認証情報、秘密情報 | guides/12-keychain.md |
| CoreData | 複雑なリレーショナルデータ | guides/13-coredata.md |
| Realm | 高速、シンプルなDB | guides/14-realm.md |
| FileManager | ファイル、画像 | guides/15-file-storage.md |
ネットワーク通信
ベストプラクティス
コーディング規約
→ references/coding-standards.md
Dependency Injection
→ references/dependency-injection.md
非同期処理
→ references/async-programming.md
メモリ管理
→ references/memory-management.md
エラーハンドリング
→ references/error-handling-best-practices.md
よくある問題
クラッシュ・エラー
| 問題 | 原因 | 解決方法 |
|---|---|---|
| "Thread 1: signal SIGABRT" | 制約エラー、強制アンラップ | incidents/crashes/ |
| メモリリーク | 循環参照 | incidents/memory-leaks/ |
| "Could not cast value" | 型キャストエラー | incidents/type-errors/ |
詳細: references/troubleshooting.md
パフォーマンス問題
→ ios-performance Skillを参照
セキュリティ問題
→ ios-security Skillを参照
Agent連携
このSkillを使用するAgents
architecture-advisor-agent
- プロジェクトに最適なアーキテクチャを提案
- Thoroughness:
thorough
code-generator-agent
- アーキテクチャパターンに従ったコード生成
- Thoroughness:
medium
refactoring-agent
- 既存コードのリファクタリング提案
- Thoroughness:
thorough
troubleshooter-agent
- エラー・クラッシュの原因分析と解決策提案
- Thoroughness:
thorough
推奨Agentワークフロー
新規機能実装時(順次実行)
architecture-advisor-agent (設計)
→ code-generator-agent (実装)
→ test-generator-agent (テスト作成)
→ code-review-agent (レビュー)
トラブルシューティング時(並行実行)
troubleshooter-agent +
performance-profiler-agent +
memory-analyzer-agent
→ 結果統合 → 解決策提案
クイックリファレンス
頻出パターン
MVVM ViewModel例
class UserProfileViewModel: ObservableObject {
@Published var user: User?
@Published var isLoading = false
@Published var errorMessage: String?
private let userRepository: UserRepositoryProtocol
init(userRepository: UserRepositoryProtocol) {
self.userRepository = userRepository
}
func fetchUser(id: String) async {
isLoading = true
defer { isLoading = false }
do {
user = try await userRepository.fetchUser(id: id)
} catch {
errorMessage = error.localizedDescription
}
}
}
API Client例
protocol APIClientProtocol {
func request<T: Decodable>(_ endpoint: Endpoint) async throws -> T
}
class APIClient: APIClientProtocol {
func request<T: Decodable>(_ endpoint: Endpoint) async throws -> T {
let request = try endpoint.asURLRequest()
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpResponse = response as? HTTPURLResponse,
(200...299).contains(httpResponse.statusCode) else {
throw APIError.invalidResponse
}
return try JSONDecoder().decode(T.self, from: data)
}
}
詳細ドキュメント
Guides(詳細ガイド)
アーキテクチャ
UI開発 6. SwiftUI基礎 7. SwiftUI State管理 8. SwiftUIアニメーション 9. UIKit基礎 10. AutoLayoutマスター
データ管理 11. UserDefaults 12. Keychain 13. CoreData 14. Realm 15. ファイルストレージ 16. ネットワーク基礎 17. APIクライアント設計 18. エラーハンドリング
Checklists(チェックリスト)
Templates(テンプレート)
References(リファレンス)
Incidents(過去の問題事例)
学習リソース
- 📚 Swift Programming Language
- 📖 Apple Human Interface Guidelines
- 🎥 WWDC Videos
- 📘 Ray Wenderlich Tutorials
関連Skills
swiftui-patterns- SwiftUI特化ios-performance- パフォーマンス最適化ios-security- セキュリティ実装testing-strategy- テスト戦略code-review- コードレビュー
更新履歴
このSkill自体の変更履歴は CHANGELOG.md を参照