1 タブバーの設定
サンプル:33/ThumbnailShowToPreview-17を引き続き拡張していきます。
1.1 UITabBarControllerの用意
まず、最初にUITabBarControllerインスタンスを作り、ViewControllerとPreviewControllerを並列で管理してみる事にします。
ステップ28でViewControllerをUISplitViewControllerに登録したように、AppDelegateの-application:didFinishLaunchingWithOptions:メソッドでUITabBarControllerを作り、私たちのViewControllerが設定されているrootViewControllerプロパティを差し替えます。
class AppDelegate: UIResponder, UIApplicationDelegate {・・・
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
↓ストーリーボードから作られたViewControllerを取り出す
let viewController = self.window!.rootViewController!
↓UITabBarControllerを作成
let tabBarContro
この記事は会員限定です。会員登録をすると続きをお読みいただけます。
ログイン / 新規登録