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

Swiftにわか勢な自分がMacアプリを作ってRxSwiftを使えるようになった話

yimajo
April 20, 2016

 Swiftにわか勢な自分がMacアプリを作ってRxSwiftを使えるようになった話

yimajo

April 20, 2016
Tweet

More Decks by yimajo

Other Decks in Technology

Transcript

  1. <         

    > ͜ͷ"SSBZͷҙຯ Θ͔Γ·͔͢ʁ
  2. SY@UFYU w 3Y4XJGUͷجૅతͳ࢖͍ํ௨ΓWBMJEBUF w ݕࡧจࣈ͕͋Ε͹ݕࡧϘλϯΛ׆ੑԽ let searchValid = searchField.rx_text .map{

    text -> Bool in 0 < text.characters.count } searchValid .bindTo(searchButton.rx_enabled) .addDisposableTo(disposeBag)
  3. // ϓϩτίϧ protocol CommentType { func type() -> Comment func

    identifier() -> String func message() -> String func imageURL() -> NSURL? } enum Comment { case Tweet case Announce } // TweetΛJSON͔ΒΤϯςΟςΟԽ // HimotokiͷDecodableΛܧঝ struct Tweet: Decodable { //…লུ… } // ϓϩτίϧͷ࣮૷෦ extension Tweet: CommentType { //…লུ… } // ΞϓϦ͔Βͷϝοηʔδ৘ใ struct Announce: CommentType { //…লུ… }
  4. 5XFFU4FBSDI 7JFX$POUSPMMFS $PNNFOU'MPX 1SFTFOUFS w 6*͔ΒͷΠϕϯτΛॲཧ w ݕࡧ͢ΔจݴΛೖྗ w දࣔ͢Δը໘ΛબͿ

    w 5XFFU4USFBN"1*ͷ 6TF$BTFΛݺͼग़͢ w "OOPVODF6TF$BTFΛݺ ͼग़͢ w NFSHF͠TVCTDSJCF w 7JFXʹͯ͠ը໘্ʹྲྀ͢ 5XJUUFS4USFBN"1* 6TF$BTF w 5XJUUFS4USFBN"1*Λݺ ͼग़͠1VCMJTI4VCKFDU "OOPVODF 6TF$BTF w ΞϓϦ͕ࣗಈͰදࣔ͢Δ ίϝϯτΛ0CTFSWBCMF ʹ 1SFTFOUBUJPO૚ %PNBJO૚ *OGSB૚ 5XJUUFS"1* )JNPUPLJ 5XFFUදࣔ͸ϨΠϠʔυ෩ΞʔΩςΫνϟ ࢀߟ IUUQTUFDISFDSVJUNQDPKQNPCJMFQPTU w )JNPUPLJ͸͍͍ͧ w 4USFBN"1* Λݺͼग़ͤΔ