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

RxSwiftでTwitterの
ライブラリを作ってる話 / RxTwift

Mihyaeru
March 12, 2016

RxSwiftでTwitterの
ライブラリを作ってる話 / RxTwift

RxSwiftでTwitterの
ライブラリを作ってる話

Mihyaeru

March 12, 2016
Tweet

More Decks by Mihyaeru

Other Decks in Technology

Transcript

  1. OAuth • OAuthΛSwiftͰ࣮૷͍ͯ͠ΔϥΠϒϥϦ͸͋Δ • https://github.com/OAuthSwift/OAuthSwift • ͦΜͳʹଟػೳ͸ඞཁͳ͔ͬͨ • ετϦʔϛϯάʹରԠͰ͖ͳͦ͏ •

    ͱ͍͏Θ͚Ͱࣗ࡞ • HMAC-SHA1͚ͩCryptoSwiftʹґଘ • https://github.com/krzyzanowskim/CryptoSwift • ඞཁͳػೳΑΓଟػೳ͗͢Δ͔Βґଘ͔Β֎͍ͨ͠
  2. ΦϒδΣΫτϚοϐϯά • README͔ΒҾ༻ struct User { let id: Int let

    name: String let email: String? let role: Role let companyName: String let friends: [User] }
  3. ΦϒδΣΫτϚοϐϯά • README͔ΒҾ༻ extension User: Decodable { static func decode(j:

    JSON) -> Decoded<User> { return curry(User.init) <^> j <| "id" <*> j <| "name" <*> j <|? "email" <*> j <| "role" <*> j <| ["company", "name"] <*> j <|| "friends" } }
  4. ݱঢ়Ͱ͖͍ͯΔൣғ • OAuthೝূʹΑΔ௨৴ • GET/POST status/* ͷAPI • GET lists/*

    ͷAPI • ࣮૷ࡁΈAPIͷϨεϙϯεʹରԠ͢ΔΦϒδΣΫτ • TwitterଆΤϥʔʹରԠ͢ΔΦϒδΣΫτ