- 発表者:
- 日時:
- 2013.07.13
- 場所:
- iOS部 @下北沢オープンソースCafe
- テーマ:
- Deployment Target:
6.0
ARC
Universal
xib
(story board
は利用しない)- ターゲットが2つ存在 (iOctocat, iOctocat Beta)
CocoaPods
bootstrap.sh
: bundler経由でインストール
HokeyApp
をベータ版配布に利用
- Extensions
- 標準APIのカテゴリ拡張
- メソッド名に接頭辞を付加
- External
- 外部から取り込んだクラス (CocoaPodsで管理されていないクラス)
- Domain
- ドメインロジック (ビジネスロジック)
- Services
- Controller
- View
- Assets
- シンタックスハイライト用ファイル一式
- IBFiles
- xibファイル (story board, autolayoutは使用しない)
- Images
- Sounds
- 効果音
- IOCApplication
- UIApplicationの継承クラス
- IOCAppConstants.h
- 定数ファイル
- JLog.h
- ログ出力のマクロ
- Expectaを採用
例: News (Events) の更新
GHEvents
(→ GHCollection → GHResource)GHEvent
IOCMyEventsController
(→ IOCEventsController → UITableViewController)IOCEventCell
(→ IOCTextCell → UITableViewCell)
IOCMenuController
- 認証ユーザーに関連するフィードを管理
- "News":
/users/:user/received_events/public
(ユーザーが受け取ったイベント) - "Activity":
/users/:user/events/public
(ユーザー自身のイベント) feeds
プロパティに2つのGHEvents
を格納 (UISegmentedControlの状態でevents
プロパティの値が変化)NSArray
でなくGHCollection
で、オブジェクト群を管理setupPullToRefresh
メソッドでデータの取得処理を追加
GHEvents
(→ GHCollection → GHResource)load*
メソッドでデータ取得onLoadSuccess
ブロックで取得したデータを格納 (setValues
メソッドを経由)- 継承先クラス
GHEvents
で、setValues
メソッドをオーバーライド (jsonデータからオブジェクトクラスへの変換)
- bootstrap.shによる依存環境の構築
https://github.com/dennisreimann/ioctocat/blob/v1.8.1.7/bootstrap.sh#L9 - CocoaPods経由のライブラリライセンス表示の自動生成
https://github.com/dennisreimann/ioctocat/blob/v1.8.1.7/Podfile#L18 (参考) - その他のライブラリライセンス表示の自動生成 (build時にスクリプト実行) https://github.com/dennisreimann/ioctocat/blob/v1.8.1.7/ThirdPartyLicenses/licenses.pl
- fork先で独自カスタマイズしたライブラリをCocoaPodsで取り込み
https://github.com/dennisreimann/ioctocat/blob/v1.8.1.7/Podfile#L13 - configuration (debug, beta, release) 毎で通信先を切り替え
https://github.com/dennisreimann/ioctocat/blob/v1.8.1.7/Classes/IOCApiClient.m#L16 - schemeの共有
https://github.com/dennisreimann/ioctocat/tree/v1.8.1.7/iOctocat.xcodeproj/xcshareddata/xcschemes - NSDictionaryインスタンスからの値取得時は、基本的に返り値の型を指定 https://github.com/dennisreimann/ioctocat/blob/v1.8.1.7/Classes/Extensions/NSDictionary_IOCExtensions.h
- 標準API拡張クラスの名前を "+" でなく、 "_" で表現
- TableViewCell設計の妥当性
- オブジェクトの保持
- クラス接頭辞が複数存在する理由 (IOC, GH)
- UIApplicationを継承する理由 (iOctocatクラスを分離する理由)
- MainWindow.xibから初期構成を生成
- ターゲットを2つに分割するメリット