• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
 

1画面から始めるStoryboard

on

  • 257 views

1画面から始めるStoryboard。

1画面から始めるStoryboard。
第56回 Cocoa勉強会関西の発表資料。

Statistics

Views

Total Views
257
Views on SlideShare
226
Embed Views
31

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 31

https://twitter.com 31

Accessibility

Categories

Upload Details

Uploaded via SlideShare as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    1画面から始めるStoryboard 1画面から始めるStoryboard Presentation Transcript

    • 1画面から始めるStoryboard 2014.06.21 ふじしげ ゆういち @nakiwo
    • 今日のテーマ •Storyboard使ってますか? •少しずつ使ってみよう
    • サンプルコード https://github.com/nakiwo/MiniStoryboard
    • Storyboard •XIBの進化版 •ViewControllerの集合 •UIStoryboardSegue(VC間の関連)
    • Storyboardは必須? •Storyboardを使わなくてもUIは作れる •XIB •コード •しかし…
    • Storyboardでしか できない事がある •TableView Dynamic Prototype •Static TableView •ViewController自体の設定 •Top/Bottom Layout Guide
    • XIB Storyboard ViewController自体の設定 Segue TableView Dynamic Prototype Static TableView Top/Bottom Layout Guide Auto Layout Baseローカライズ
    • XIB Storyboard ViewController自体の設定 ● Segue ● TableView Dynamic Prototype ● Static TableView ● Top/Bottom Layout Guide ● Auto Layout ● ● Baseローカライズ ● ●
    • XIB Storyboard ViewController自体の設定 ● Segue ● TableView Dynamic Prototype ● Static TableView ● Top/Bottom Layout Guide ● Auto Layout ● ● Baseローカライズ ● ●
    • •Dynamic Prototype、Static Table Viewが使いたい
    • •全面的にStoryboardに移行しない場合 •既存のプロジェクトの変更とか •そんな時に..
    • 1画面 1Storyboard !
    • •Segueを使わず1画面だけ配置すれば、 XIBとStoryboardはほぼ同じ •Storyboardでしか使えない機能が使え る
    • XIB Storyboard
    • // XIB ! MySecondViewController *vc = [[MySecondViewController alloc] initWithNibName:nil bundle:nil]; [self presentViewController:vc animated:YES completion:nil]; ! ! // Storyboard ! UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@“MyThirdViewController" bundle:nil]; MyThirdViewController *vc = (MyThirdViewController *)[storyboard instantiateInitialViewController]; ! [self presentViewController:vc animated:YES completion:nil];
    • •後はいつもどおりで
    • 補足 •XIBはViewControllerのインスタンス を含まない (VCはFile s owner) •initWithNibName:bundle: •StoryboardはViewControllerインス タンス自体がアーカイブされている •initWithCoder: / awakeFromNib
    • その他メリット •Storyboardの単位が小さいので、コン フリクトが最小
    • 1画面 1Storyboard !
    • おわり