iOS Development Skill
📋 目次
概要
このSkillは、iOS開発における全ての側面をカバーします:
- ✅ アーキテクチャパターン(MVVM, Clean Architecture, VIPER)
- ✅ SwiftUI/UIKit開発
- ✅ Reactive Programming(Combine, RxSwift)
- ✅ データ永続化(CoreData, Realm, UserDefaults)
- ✅ ネットワーク通信
- ✅ 非同期処理(async/await, DispatchQueue)
- ✅ Dependency Injection
- ✅ エラーハンドリング
- ✅ メモリ管理
- ✅ よくあるトラブルと解決方法
📚 公式ドキュメント・参考リソース
このガイドで学べること: アーキテクチャパターン、設計原則、実装テクニック 公式で確認すべきこと: 最新API、iOS 18の新機能、SwiftUI/UIKitリファレンス、App Store審査ガイドライン
主要な公式ドキュメント
-
Apple Developer Documentation - Apple公式ドキュメント
-
Swift.org - Swift言語公式サイト
- The Swift Programming Language - 完全ガイド
- Swift Evolution - 言語仕様の進化
-
Human Interface Guidelines - UIデザインガイドライン
- iOS、iPadOS、watchOS、macOSのデザイン原則
- コンポーネント使用ガイド
-
App Store Review Guidelines - 審査ガイドライン
- 申請前の必読事項
- リジェクト回避のポイント
関連リソース
- WWDC Videos - 年次カンファレンス動画
- Swift Forums - Swift公式フォーラム
- Hacking with Swift - チュートリアル集
- Ray Wenderlich - iOS開発教材
- Swift by Sundell - 実践的なTips
学習の進め方
完全初心者向け:基礎から学ぶiOS開発
対象者:プログラミング初心者、iOS開発が初めての方
学習時間:約7〜9時間
iOS開発の基礎を体系的に学べる7つのガイドを用意しました。順番に学習することで、実践的なiOSアプリを構築できるようになります。
📚 基礎ガイド(全7章)
-
iOS開発とは (30〜40分)
- iOS開発の基本概念
- iOSアプリの特徴
- 開発に必要なもの
- 技術スタック
-
Swift基礎 (1〜1.5時間)
- Swift言語の基本文法
- 変数、定数、データ型
- 制御構文
- 関数とオプショナル
-
Xcode入門 (40〜50分)
- Xcodeの基本操作
- プロジェクトの作成方法
- シミュレータの使い方
- 便利なショートカット
-
SwiftUI基礎 (1〜1.5時間)
- SwiftUIの基本概念
- 基本的なViewコンポーネント
- レイアウトの作成方法
- 修飾子(Modifier)
-
レイアウトとUI (1〜1.5時間)
- 高度なレイアウト技術
- Spacer、Divider、ScrollView
- カスタムコンポーネント
- レスポンシブデザイン
-
状態管理 (1〜1.5時間)
- @State による状態管理
- @Binding による親子間のデータ共有
- @StateObject / @ObservedObject
- フォーム入力
-
初めてのアプリ作成 (2〜3時間)
- 総合演習:メモアプリ
- MVVMアーキテクチャ
- データの永続化
- CRUD操作の実装
🎯 学習の進め方
Week 1: 01→02→03(環境構築・Swift基礎)
Week 2: 04→05(SwiftUI・レイアウト)
Week 3: 06→07(状態管理・実践)
学習後に作れるもの:
- ✅ メモアプリ
- ✅ TODOリスト
- ✅ カウンターアプリ
いつ使うか
自動的に参照されるケース
- 新しい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 を参照