Skip to content

HomeWork 1.2 UIViewControllerとModalViewController

tamotamago edited this page Apr 16, 2013 · 1 revision

UIViewControllerとUIModalViewControllerを使った課題です。 途中までは講義中のものと同じです

課題

概要

  • UIViewControllerのView上にボタンを設置し、そのボタンを押すとモーダルが立ち上がる
    • 立ち上げるモーダルは新しいViewControllerクラスを作ってください
  • 立ち上がるモーダルにはボタンが一つついており、そのボタンをタップするとモーダルが閉じる
  • モーダルを殺す処理はモーダル自身がするのではなく、delegateを用いてモーダルを表示させた親が殺すようにする
  • ---------ここまでは講義中のものと同じ------------
  • modalが閉じた瞬間に新しいmodalを表示するようにしてください

イメージ

遷移イメージ

見づらい場合はこちらを→https://github.com/mixi-inc/iOSTraining/blob/master/Doc/Images/HomeWork/1-2-1.png

少しだけ解説

dismissViewControllerにはcompletitionBlockという引数があります。 この引数には、モーダルが閉じきった時に実行するクロージャ(Blocks)を渡します。Blocksについては、また後日解説がありますが、 「完了時に実行したい処理」を書けば問題ありません。

目的

  • UIViewControllerを作れるようになる
  • ModalViewを表示させることができるようになる
  • delegateパターンを実装できるようになる
  • completitionBlockが使えるようになる
  1. 導入
  2. Objective C の基礎
  3. メモリ管理
  4. UIViewController1 - UIViewController のカスタマイズ
  5. UIViewController2 - ModalViewController
  6. UIViewController3 - ライフサイクル
  7. UIKit 1 - container, rotate-
  8. UINavigationController
  9. UITabController
  10. Custom Container View Controller
  11. Supporting Multiple Interface Orientations
  12. UIKit 2- UIView -
  13. UIView
  14. UIView のカスタマイズ
  15. UIView Animation
  16. UIKit 3 - table view -
  17. UITableView について
  18. UITableViewとNavigationController
  19. custom UITableViewCell の作成
  20. 4.4 UITableViewのその他のオプション、カスタマイズ
  21. UIKit 4 - images -
  22. UIImage (CoreGraphics)
  23. UIImageView
  24. Accets Library
  25. CoreImage
  26. UIKit 4 - text -
  27. UILabel
  28. UITextView
  29. KeybordNotification
  30. 非同期処理系
  31. NSURLConnection (json シリアライザ)
  32. Blocks
  33. GCD
  34. ローカルキャッシュ
  35. UserDefaults
  36. FileManager
  37. CoreData
  38. SQLite
  39. Instruments
  40. leak
  41. time profiler
  42. その他
  43. 単体テスト (GHUnit)
  44. 結合テスト (KIF)
  45. cocoaPods でライブラリ管理

edit sidebar

Clone this wiki locally