Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swiftで作るiOSアプリ開発入門_08

 Swiftで作るiOSアプリ開発入門_08

Schoo講義資料

jollyjoester

April 02, 2016
Tweet

More Decks by jollyjoester

Other Decks in Education

Transcript

  1. ͦͷલʹલճͷ࣭͝໰
 ʢΞϓϦͰԻ੠Λ໐Βͯ͠ΈΔʣ • ྫ֎ॲཧͬͯͳΜͰ͍ΔΜͰ͔͢ʁϋʔυ΢ΣΞΛ࢖͏Α ͏ͳϓϩάϥϜ͸ྫ֎ॲཧ͕ඞཁͳ͜ͱ͓͓͍ΜͰ͢ ͔ ʁfrom தࢁ ཅհ͞Μ ‣

    ྫ֎͸ΤϥʔॲཧΛ༰қʹ͢ΔͨΊʹ͋Γ·͢ɻͲ͜Ͱ Τϥʔ͕ൃੜ͢Δ͔͕Θ͔Γ΍͘͢ͳΓ·͢ʢdo-tryͷ தͰൃੜ͢Δʣ͠ɺΤϥʔ͕ൃੜͨ͠ͱ͖ʹ͠ͳ͚Ε ͹ͳΒͳ͍͜ͱ΋͸͖ͬΓͱ͠·͢ʢcatchͷதʣɻ࠷ ۙͷݴޠͰ͋Ε͹͍͍ͩͨྫ֎ͱ͍͏࢓૊ΈΛඋ͑ͯ ͍·͢ɻ 9
  2. ͦͷલʹલճͷ࣭͝໰
 ʢΞϓϦͰԻ੠Λ໐Βͯ͠ΈΔʣ • ࠓ೔ͷतۀ಺༰ͷԠ༻ͰϏʔτϚχΞͷΑ͏ͳΞϓϦ΋࡞ Εͯ͠·͍·͔͢ʁ౰࣌ྲྀߦͬͯϋϚΓ·ͨ͠ͷͰɺ໘ന ͦ͏ͱࢥ͍·ͨ͠ɻfrom อࢤ ݈Ұ͞Μ ‣ ΋ͪΖΜ࡞Ε·͢ʂ࣍ճͷδΣενϟʔΛݕ஌͢ΔΛ

    ֶ΂͹λοϓ΍εϫΠϓΛ࢖ͬͨΞϓϦΛ࡞ΕΔΑ͏ ʹͳΓ·͢ɻBGMΛྲྀͭͭ͠ɺλοϓ΍εϫΠϓ͕λ Πϛϯάྑ͘͞Ε͔ͨΛ൑ఆͯ͠ɺGreatʂͱ͔Λදࣔ ͢ΔΑ͏ʹ͢Ε͹Πέͦ͏Ͱ͢Ͷɻ 10
  3. ৽͍͠ը໘Λ࡞Δ
 (ରԠ͢ΔιʔεϑΝΠϧΛ࡞੒͢Δ) 20 ߲໨ આ໌ ೖྗ஋ Class: ͜Ε͔Β࡞ΔViewControllerͷ໊લ SecondViewController Subclass

    of: ͲΜͳػೳΛҾ͖ܧ͙͔ UIViewController Also create XIB file ݸผը໘ͷݟͨ໨Λ࡞ΔXIBͱ͍͏΋ ͷΛ࡞Δ νΣοΫ͠ͳ͍ Language: ࢖༻͢Δϓϩάϥϛϯάݴޠ Swift
  4. AppDelegate 56 ϝιου໊ ݺ͹ΕΔλΠϛϯά application:didFinishLaunching WithOptions ΞϓϦ͕ϝϞϦ্ʹͳ͍ঢ়ଶͰ ىಈͨ͠ͱ͖ applicationWillResignActive ΞϓϦ͕ΞΫςΟϒͰͳ͘ͳΔͱ͖

    applicationDidEnterBackground ΞϓϦ͕όοΫάϥ΢ϯυ΁ ߦͬͨͱ͖ applicationWillEnterForeground ΞϓϦ͕ϑΥΞάϥ΢ϯυʹߦ͘ͱ͖ applicationDidBecomeActive ΞϓϦ͕ΞΫςΟϒʹͳͬͨͱ͖ applicationWillTerminate ΞϓϦ͕ऴྃͨ͠ͱ͖