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

Zaim API

watura
December 21, 2015

Zaim API

20151222Realm忘年会

watura

December 21, 2015
Tweet

More Decks by watura

Other Decks in Technology

Transcript

  1. APIKit, Himotoki, Realm • Zaim Swift൛Ͱ͸ - APIΛୟ͘ͷʹAPIKit - JSONΛσίʔυ͢ΔͷʹHimotoki

    - σʔλΛอଘ͢ΔͷʹRealm • ಛʹมΘͬͨ࢖͍ํͱ͔ͯ͠ͳ͍ →ࠓ೔Կ࿩ͦ͏͔ʁ 9 https://dev.zaim.net
  2. MoneyͷΞοϓσʔτ • Moneyͱ͍͏ͷ͸Ոܭ฽ͷҰ߲໨ - date : 2015-12-21 - amount: 2000

    - currency_code: JPY - comment: Realm๨೥ձͷࢀՃඅ - Category: ަࡍඅ - Genre: ԅձ - From: ࢲͷࡒ෍ - etc 10
  3. MoneyͷΞοϓσʔτ • GET, POST, PUTͱ͔Ͱऔಘૹ৴Ͱ͖Δ • GET : APIKit →

    Himotoki → Realm • POST, PUTɿ - Realm → खಈͰDictionary, StructʹೖΕΔʁ • RealmModel͔Β௚઀Dictionary࡞Ε͹ָͩʂ 11
  4. RealmศརͰͨ͠ • Object.objectSchema.properties - ϓϩύςΟҰཡ͕औಘͰ͖Δ • self[property.name] - property nameͷ஋΋औΕΔ

    • ͋ͱ͸ Listͱ͔Objectͩͬͨ࣌ͷରԠΛ͢Δ͚ͩ ͔ͳΓ؆୯ʹObject → Dictionary͕Ͱ͖·ͨ͠ • ଓ͖͸ Realm Advent Calendar 3೔໨΁ 12
  5. 14