597740ea13ea3e91be0cc8dd55b6d43646ed0f7R64">64
ShareRecentGroupInfo.add(groupItem)
@@ -13,7 +13,7 @@ import RxDataSources |
||
13 | 13 |
|
14 | 14 |
public protocol PhotoDetailViewModelDelegate: class { |
15 | 15 |
func didSelected() |
16 |
- func navigateToGroup(_ item: GroupItem) |
|
16 |
+ func navigateToGroup(_ item: GroupItem, photoItems: [PhotoItem]) |
|
17 | 17 |
} |
18 | 18 |
|
19 | 19 |
|
@@ -180,7 +180,9 @@ public final class PhotoDetailViewModel { |
||
180 | 180 |
|
181 | 181 |
extension PhotoDetailViewModel { |
182 | 182 |
public func navigateToGroup() { |
183 |
- delegate?.navigateToGroup(GroupItem(json: _items.value[currIndex].toJSON() as [String : AnyObject])) |
|
183 |
+ let currItem = _items.value[currIndex] |
|
184 |
+ delegate?.navigateToGroup(GroupItem(json: currItem.toJSON() as [String : AnyObject]), |
|
185 |
+ photoItems: _items.value.filter { $0.photo_id == currItem.photo_id }) |
|
184 | 186 |
} |
185 | 187 |
|
186 | 188 |
public func didSelected() { |
@@ -38,7 +38,7 @@ extension HomeCoordinator: HomeViewModelDelegate { |
||
38 | 38 |
let coordinator = PhotoDetailCoordinator(vc, |
39 | 39 |
nav: navigationController, |
40 | 40 |
viewModel: PhotoDetailViewModel(items: items, currIndex: currIndex)) |
41 |
- coordinator.start().subscribe().disposed(by: disposeBag) |
|
41 |
+ coordinate(to: coordinator).subscribe().disposed(by: disposeBag) |
|
42 | 42 |
navigationController.pushViewController(coordinator.photoDetailViewController) |
43 | 43 |
} |
44 | 44 |
|
@@ -31,9 +31,9 @@ final class PhotoDetailCoordinator: BaseCoordinator<Void> { |
||
31 | 31 |
} |
32 | 32 |
|
33 | 33 |
extension PhotoDetailCoordinator: PhotoDetailViewModelDelegate { |
34 |
- func navigateToGroup(_ item: GroupItem) { |
|
34 |
+ func navigateToGroup(_ item: GroupItem, photoItems: [PhotoItem]) { |
|
35 | 35 |
let vc = GroupViewController.instantiate() |
36 |
- vc.viewModel = GroupViewModel(groupItem: item) |
|
36 |
+ vc.viewModel = GroupViewModel(groupItem: item, items: photoItems) |
|
37 | 37 |
let coordinator = GroupCoordinator(vc, |
38 | 38 |
navigationController: navigationController, |
39 | 39 |
navigationSource: .photoDetail) |