17
Creating ContainerView Controller StoryBoardContainerViewを使ってみる 2014. 05. 17

Ojbecitve-C Use ContainerView (Stroyboard)

Embed Size (px)

DESCRIPTION

iOS勉強会(KJ-CODE)発表資料 StoryboardのContainerVIewについて

Citation preview

Page 1: Ojbecitve-C Use ContainerView (Stroyboard)

Creating ContainerView Controller

StoryBoardのContainerViewを使ってみる

2014. 05. 17

Page 2: Ojbecitve-C Use ContainerView (Stroyboard)

About Me

악당잰 / 프로그래머 / 일본 동경근무 (Crewja) / 아이폰 앱 개발중 / 아이폰개발 모임(KJ-CODE)멤버/ 東京勤務 / プログラマ、iPhone アプリ開発、下町居酒屋が好き。 iOS研究会(KJ-Code)の活動をやってます。!blog: http://dolfalf.tistory.com/

Page 3: Ojbecitve-C Use ContainerView (Stroyboard)

まずContainerViewController から調べてみよう。

Page 4: Ojbecitve-C Use ContainerView (Stroyboard)

一般的によく使っているのはこんなものです。

UINavigationController

UITabbarController

UIPageViewController

ContainerViewController

Page 5: Ojbecitve-C Use ContainerView (Stroyboard)

ContainerView!Controller

ContentView

これをControllerに作ります。

Page 6: Ojbecitve-C Use ContainerView (Stroyboard)

Storyboardにあります!

こいつをViewControllerにドロップするだけでOK。

Page 7: Ojbecitve-C Use ContainerView (Stroyboard)

1.ContainerView 追加して。。

3. 最後にセグエ(Segue)でつなぎます。

2.ViewController追加!

画面遷移させる画面があればContentViewControllerを作成し、2、3を繰り返しします。

Page 8: Ojbecitve-C Use ContainerView (Stroyboard)

今までのContentViewと何が違うの?

それぞれのContentViewは lifeCycleを持つ。

一つのViewControllerにコードが集中するのを回避。

Storyboardと相性が良いのでコーディング量が減る。

Page 9: Ojbecitve-C Use ContainerView (Stroyboard)

Container!ViewController

ContentView!Controller1

ContentView!Controller2

LoadViewDidLoad {...}

ViewWillAppear {...}

ViewDidLoad {...}

ViewWillAppear {...}

ViewDidAppear {...}

ViewDidAppear {...}

Page 10: Ojbecitve-C Use ContainerView (Stroyboard)

Container!ViewController

ContentView!Controller1

ContentView!Controller2

Push

Pop

ViewDidLoad {...}

ViewWillAppear {...}

ViewWillDisappear {...}

ViewDidDisAppear {...}

ViewWillDisappear {...}

ViewWillAppear {...}

ViewDidDisAppear {...}

ViewDidAppear {...}

ViewDidAppear {...}

Page 11: Ojbecitve-C Use ContainerView (Stroyboard)

Demo

[email protected]:dolfalf/ContainerViewControllerSample.git

Page 12: Ojbecitve-C Use ContainerView (Stroyboard)

おまけ

Page 13: Ojbecitve-C Use ContainerView (Stroyboard)

遷移アニメーション効果を自分で作りたい場合は?

Transition Animation

セグエ(Segue)のOverriding

Page 14: Ojbecitve-C Use ContainerView (Stroyboard)

기본 애니메이션은 클릭만으로 가능하다능...

애니메이션을 커스텀하고 싶을경우에는 Custom을 선택하여 코딩해주면 됨.

Page 15: Ojbecitve-C Use ContainerView (Stroyboard)

詳しい内容はブログを参考してください。http://dolfalf.tistory.com/104

Page 16: Ojbecitve-C Use ContainerView (Stroyboard)

Comming Soon!

Page 17: Ojbecitve-C Use ContainerView (Stroyboard)

参考資料はこちら。

https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/BasicViewControllers/BasicViewControllers.html#//apple_ref/doc/uid/TP40007457-CH101-SW1

https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/RespondingtoDisplay-Notifications/RespondingtoDisplay-Notifications.html#//apple_ref/doc/uid/TP40007457-CH12-SW1

ご清聴ありがとうございました。