1 ナビゲーションとの連携
サンプル:34/Table-08をナビゲーションバー付きに拡張します。
1.1 UINavigationControllerの準備
ステップ28でViewControllerをUISplitViewControllerに登録したように、AppDelegateの-application:didFinishLaunchingWithOptions:メソッドでUINavigationControllerを作り、私たちのViewControllerが設定されているrootViewControllerプロパティを差し替えます。
class AppDelegate: UIResponder, UIApplicationDelegate {・・・
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// ストーリーボードから作られたViewControllerを取り出す
let viewController = self.window!.rootViewController!
// viewControllerをルートに設定してUINavigationControllerを作成。
UIWindowのrootViewControllerとして設定する
self.window?.rootViewCont
この記事は会員限定です。会員登録をすると続きをお読みいただけます。
ログイン / 新規登録