Upload
jaeeun-lee
View
1.063
Download
0
Embed Size (px)
DESCRIPTION
iOS勉強会(KJ-CODE)発表資料 StoryboardのContainerVIewについて
Citation preview
Creating ContainerView Controller
StoryBoardのContainerViewを使ってみる
2014. 05. 17
About Me
악당잰 / 프로그래머 / 일본 동경근무 (Crewja) / 아이폰 앱 개발중 / 아이폰개발 모임(KJ-CODE)멤버/ 東京勤務 / プログラマ、iPhone アプリ開発、下町居酒屋が好き。 iOS研究会(KJ-Code)の活動をやってます。!blog: http://dolfalf.tistory.com/
まずContainerViewController から調べてみよう。
一般的によく使っているのはこんなものです。
UINavigationController
UITabbarController
UIPageViewController
ContainerViewController
ContainerView!Controller
ContentView
これをControllerに作ります。
Storyboardにあります!
こいつをViewControllerにドロップするだけでOK。
1.ContainerView 追加して。。
3. 最後にセグエ(Segue)でつなぎます。
2.ViewController追加!
画面遷移させる画面があればContentViewControllerを作成し、2、3を繰り返しします。
今までのContentViewと何が違うの?
それぞれのContentViewは lifeCycleを持つ。
一つのViewControllerにコードが集中するのを回避。
Storyboardと相性が良いのでコーディング量が減る。
Container!ViewController
ContentView!Controller1
ContentView!Controller2
LoadViewDidLoad {...}
ViewWillAppear {...}
ViewDidLoad {...}
ViewWillAppear {...}
ViewDidAppear {...}
ViewDidAppear {...}
Container!ViewController
ContentView!Controller1
ContentView!Controller2
Push
Pop
ViewDidLoad {...}
ViewWillAppear {...}
ViewWillDisappear {...}
ViewDidDisAppear {...}
ViewWillDisappear {...}
ViewWillAppear {...}
ViewDidDisAppear {...}
ViewDidAppear {...}
ViewDidAppear {...}
Demo
[email protected]:dolfalf/ContainerViewControllerSample.git
おまけ
遷移アニメーション効果を自分で作りたい場合は?
Transition Animation
セグエ(Segue)のOverriding
기본 애니메이션은 클릭만으로 가능하다능...
애니메이션을 커스텀하고 싶을경우에는 Custom을 선택하여 코딩해주면 됨.
詳しい内容はブログを参考してください。http://dolfalf.tistory.com/104
Comming Soon!
参考資料はこちら。
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
ご清聴ありがとうございました。