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

Source Code Generator for Team Development/code-generator-for-team-development

Source Code Generator for Team Development/code-generator-for-team-development

Otemachi.swift x Kyobashi.swift #01

253696343a018052ff394eb1f63e3d6f?s=128

Taketo Yoshida

August 08, 2017
Tweet

Transcript

  1. 4PVSDF$PEF(FOFSBUPS GPS5FBN%FWFMPQNFOU 5BLFUP:PTIJEB 0UFNBDIJTXJGUY,ZPCBTIJTXJGU

  2.  5BLFUP:PTIJEB J04%FWFMPQFS!/JLLFJ فٗꅿ椔⚾ծة؎桬㕂" !5BNB0CKFDU !UBNBOZBO J04%$ד涫㠡׃תׅ )&*'חאְג

  3.  .Z8PSLT

  4.  5-%3 4UBOEBSEJ[FZPVSBSDIJUFDUVSFPGBOBQQMJDBUJPOJOZPVSUFBN 4PVSDF$PEF(FOFSBUPSIFMQTPVUXJUIDPEFTUBOEBSEJ[BUJPO %FNP

  5.  5FBN%FWFMPQNFOUJT%JDVMU

  6.  4UBOEBSEJ[FZPVSBSDIJUFDUVSFBOEDPEJOHTUZMF ,FFQTPVSDFDPEFDMFBO )PXUPJOWJUFOFXDPNFS

  7.  4UBOEBSEJ[FZPVSBSDIJUFDUVSFBOEDPEJOHTUZMF ,FFQTPVSDFDPEFDMFBO )PXUPJOWJUFOFXDPNFS

  8.  )PXUP4UBOEBSEJ[F ZPVSBSDIJUFDUVSFBOEDPEJOHTUZMF

  9.  4PVSDF$PEF(FOFSBUPS

  10.  (FOFSBNCB 4PVSDF$PEF(FOFSBUPSXPSLJOHXJUI9DPEF %FTJHOFEUPHFOFSBUF7*1&3NPEVMFT &BTZUPDVTUPNJ[F

  11.  view_model.swift.liquid SomeViewModel.swift // // {{ module_info.file_name }} // {{

    module_info.project_name }} // // Created by {{ developer.name }} on {{ date }}. // Copyright © {{ year }} {{ developer.company }}. // All rights reserved. // import Foundation import RxSwift import RxCocoa protocol {{ module_info.name }}ViewModel: class { var isLoading: Driver<Bool> { get } var hasError: Driver<Bool> { get } } // // SomeViewModelViewModel.swift // Nikkei // // Created by Taketo Yoshida on 23/02/2017. // Copyright © 2017 nikkei. // All rights reserved. // import Foundation import RxSwift import RxCocoa protocol SomeViewModel: class { var isLoading: Driver<Bool> { get } var hasError: Driver<Bool> { get } }
  12.  5IF&FDUPGVTJOH(FOFSBNCB 3FEVDFUIFSJTLPGPSJHJOBMJNQMFNFOUBUJPO %POUOFFEUPXSJUFDPNNPODPEF "VUPNBUJDBMMZBEETPVSDFDPEFNPEVMFTJOUPZPVS9DPEF1SPKFDU

  13.  6TF$BTFJO/JLLFJ

  14.  5IF"SDIJUFDUVSFPG/JLLFJ"QQ .77. 3Y4XJGU  7*1&38JSFGSBNF $POTUSVDUPS*OKFDUJPO &ODBQTVMBUFTB6TF$BTFPSB'VODUJPOBMJUZBT.PEVMF

  15.  $MBTTFT .PEVMFT "SUJDMF-JTU /JLLFJ $PNNPO 4FBSDI -PHJO &ODBQTVMBUFTB6TF$BTFPSB'VODUJPOBMJUZBT.PEVMF 6TF$BTFPS'VODUJPOBMJUZ

  16.  7JFX "SUJDMF-JTU 7JFX.PEFM -BZFSTJOBNPEVMF .PEFM 8JSFGSBNF #VJMEFS

  17.  .Z1SPKFDU(FOFSBNCB5FNQMBUF

  18.  view_model.swift.liquid protocol {{ module_info.name }}ViewModel: class { /** Output

    Definition of ViewModel */ var isLoading: Driver<Bool> { get } var hasError: Driver<Bool> { get } var toastMessage: Driver<String> { get } /** Input Definition of ViewModel */ }
  19.  view_model.swift.liquid final class {{ module_info.name }}ViewModelImpl: {{ module_info.name }}ViewModel

    { let disposeBag = DisposeBag() // output let isLoading: Driver<Bool> let hasError: Driver<Bool> let toastMessage: Driver<String> // input init(model: {{ module_info.name }}Model, wireframe: {{ module_info.name }}Wireframe, scheduler: SchedulerService = MainSchedulerService.shared) { self.isLoading = model.isLoading .asDriver(onErrorDriveWith: Driver.empty()) self.hasError = model.errors .map({ $0.isError }) .asDriver(onErrorDriveWith: Driver.empty()) self.toastMessage = model.errors .map({ $0.description }) .filterNil() .asDriver(onErrorDriveWith: Driver.empty()) } }
  20.  %FNP

  21.  4VNNBSZ *UTEJDVMUUPTUBOEBSEJ[FZPVSBSDIJUFDUVSFBOEDPEJOHTUZMF (FOFSBNCBIFMQTPVUXJUIDPEFTUBOEBSEJ[BUJPOJOBUFBN -JOUFSUPPMT DPEJOHTUZMFHVJEFBOEDPEFSFWJFXBSFBMTPFFDUJWF

  22.  TOJLLFJDPNTBJZP

  23.  5IBOLT%