Skip to content

Commit

Permalink
Merge pull request #22 from xflagstudio/feature/addChildViewModel
Browse files Browse the repository at this point in the history
Enable to add only the viewModel to child.
  • Loading branch information
kazuki-horie-m committed Sep 24, 2020
2 parents 7bba357 + 26efa17 commit 573c18d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PODS:
- RxCocoa (5.1.1):
- RxRelay (~> 5)
- RxSwift (~> 5)
- RxController (0.10):
- RxController (0.11):
- RxCocoa (~> 5)
- RxFlow (~> 2.9)
- RxSwift (~> 5)
Expand Down Expand Up @@ -64,7 +64,7 @@ SPEC CHECKSUMS:
Reusable: 53a9acf5c536f229b31b5865782414b508252ddb
RxBinding: da433c012633802a72c2a5bec8775b86f4cddeb8
RxCocoa: 32065309a38d29b5b0db858819b5bf9ef038b601
RxController: adeab54a3771d0f12ce66b79d448a82a2b3b5930
RxController: f84e61f97e21b0d5bb7d950693fa50ecc4e77001
RxDataSources: efee07fa4de48477eca0a4611e6d11e2da9c1114
RxDataSourcesSingleSection: 4394e57ae097f33e3845cf3a57bdf7826eca2d38
RxFlow: 029e260333ef843b349ba9cb9265929941830aee
Expand Down
2 changes: 1 addition & 1 deletion RxController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'RxController'
s.version = '0.10'
s.version = '0.11'
s.summary = 'A library for developing with MVVM-C based on RxFlow and RxSwift.'

# This description is used to generate tags and improve search results.
Expand Down
5 changes: 5 additions & 0 deletions RxController/Classes/RxViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,9 @@ open class RxViewController<ViewModel: RxViewModel>: UIViewController, RxViewCon
viewModel.addChild(childController.rxViewModel)
}

open func addChildViewModel(from childController: UIViewController) {
guard let childController = childController as? RxViewControllerProtocol else { return }
viewModel.addChild(childController.rxViewModel)
}

}

0 comments on commit 573c18d

Please sign in to comment.