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

Xamarin.iOS

 Xamarin.iOS

第57回 Cocoa勉強会関西で話しました。
https://atnd.org/events/53550

USAMI Kosuke

August 09, 2014
Tweet

More Decks by USAMI Kosuke

Other Decks in Programming

Transcript

  1. Xamarin ͱ͸Կ͔ • C# ͰΞϓϦ։ൃ • iOS / Android /

    Mac • .NET / Mono ϕʔε • MonoTouch / MonoDroid / MonoMac
  2. Xamarin.iOS • MonoTouch ܦ༝Ͱશ iOS API ʹΞΫηεՄೳ • ࠷৽ SDK

    ΁ͷ௥ਵ΋ૣ͍ʢطʹ iOS 8 ରԠʣ • ໋໊͸ C# ͷྲّྀʹ͋Θͤͯ͋Δ
  3. ܕਪ࿦ var x = 1; // x ͸ int !

    var obj = new Hoge(); // obj ͸ Hoge ΦϒδΣΫτ
  4. ϥϜμࣜ // Ұ൪؆ܿͳه๏ʢܕਪ࿦ʣ x => x > 0 ! //

    ܕ΍ return Λলུ͠ͳ͍ه๏ (int x) => { return x > 0; } ! // ௨ৗͷؔ਺Ͱॻ͍ͨ৔߹ bool Hoge(int x) { return x > 0; }
  5. LINQ ! ʢΫΤϦʣ var list1 = list.Where(x => x >

    0); ! var list2 = list.Where(x => x > 0) .Select(x => x.Name);
  6. async / await ! ʢඇಉظॲཧʣ async void Hoge() { Work1();

    // ී௨ʹݺ͹ΕΔ var result = await WorkAsync(); // ผεϨου Work2(); // WorkAsync ͷޙͰݺ͹ΕΔ }
  7. MVVM Λ࢖͏ʹ͸ • C# / .NET จԽݍͰ͔ͭͪΘΕ͖ͯͨ • ͜ͷͨΊɺXamarin ͱ

    MVVM ͸૬ੑ͕Α͍ • ༨ஊɿObjective-C or Swift Ͱ΍ΔͳΒ ReactiveCocoa Λ࢖͏ͷ͕ྑ͍
  8. ϓϩδΣΫτߏ੒ • Core Project • ϓϥοτϑΥʔϜݻ༗ͷػೳ͸࢖͑ͳ͍ • Touch / Droid

    Project • ϓϥοτϑΥʔϜݻ༗ͷػೳ͕࢖͑Δ • Ͱ΋ɺView ʹ͸ϩδοΫΛॻ͔ͳ͍
  9. View ͷ࡞੒ • MVVM ͷ View = UIViewController • View

    ͷίʔυ͸࠷খݶʹ͓͑͞Δ • ը໘ϩδοΫ͸ ViewModel • xib + AutoLayout Λ׆༻ • ʢݱঢ় MvvmCross ͸ Storyboard ඇରԠʣ