- viewModel.delegate = self
|
|
|
24
|
+ photoDetailViewController.viewModel = viewModel
|
|
28
|
25
|
}
|
|
29
|
26
|
|
|
30
|
|
- func start() {
|
|
31
|
|
-
|
|
|
27
|
+ override func start() -> Observable<Void> {
|
|
|
28
|
+ photoDetailViewController.viewModel.delegate = self
|
|
|
29
|
+ return .never()
|
|
32
|
30
|
}
|
|
33
|
31
|
}
|
|
34
|
32
|
|
|
|
|
@@ -37,14 +35,15 @@ extension PhotoDetailCoordinator: PhotoDetailViewModelDelegate {
|
|
37
|
35
|
let vc = GroupViewController.instantiate()
|
|
38
|
36
|
vc.viewModel = GroupViewModel(groupItem: item)
|
|
39
|
37
|
let coordinator = GroupCoordinator(vc,
|
|
40
|
|
- navigationController: navigationController)
|
|
41
|
|
- coordinators[.group] = coordinator
|
|
|
38
|
+ navigationController: navigationController,
|
|
|
39
|
+ navigationSource: .photoDetail)
|
|
42
|
40
|
|
|
|
41
|
+ coordinate(to: coordinator).subscribe().disposed(by: disposeBag)
|
|
43
|
42
|
navigationController.pushViewController(vc)
|
|
44
|
43
|
}
|
|
45
|
44
|
|
|
46
|
45
|
func didSelected() {
|
|
47
|
|
- let vc = UIStoryboard.photoDetail.instantiateController(PhotoPreviewViewController.self)
|
|
|
46
|
+ let vc = PhotoPreviewViewController.instantiate()
|
|
48
|
47
|
vc.viewModel = shareViewModel
|
|
49
|
48
|
photoDetailViewController.presentController(vc)
|
|
50
|
49
|
}
|
|
|
|
@@ -2,8 +2,8 @@
|
|
2
|
2
|
// PhotoDetailImageCell.swift
|
|
3
|
3
|
// Paiai_iOS
|
|
4
|
4
|
//
|
|
5
|
|
-// Created by ffib on 2019/3/19.
|
|
6
|
|
-// Copyright © 2019 yb. All rights reserved.
|
|
|
5
|
+// Created by FFIB on 2019/3/19.
|
|
|
6
|
+// Copyright © 2019 FFIB. All rights reserved.
|
|
7
|
7
|
//
|
|
8
|
8
|
|
|
9
|
9
|
import UIKit
|
|
|
|
@@ -1,8 +1,8 @@
|
|
1
|
1
|
//
|
|
2
|
2
|
// PhotoDetailViewController.swift
|
|
3
|
|
-// PaiAi
|
|
|
3
|
+// Paiai_iOS
|
|
4
|
4
|
//
|
|
5
|
|
-// Created by zhengjianfei on 16/4/6.
|
|
|
5
|
+// Created by FFIB on 16/4/6.
|
|
6
|
6
|
// Copyright © 2016年 FFIB. All rights reserved.
|
|
7
|
7
|
//
|
|
8
|
8
|
|
|
|
|
@@ -97,11 +97,11 @@ extension PhotoDetailViewController {
|
|
97
|
97
|
/// bind storyboard button action
|
|
98
|
98
|
extension PhotoDetailViewController {
|
|
99
|
99
|
@IBAction func share() {
|
|
100
|
|
- let ctl = UIStoryboard.photoDetail.instantiateController(ShareViewController.self)
|
|
101
|
|
- ctl.shareContent = "我使用拍爱分享了一张美图,你也快来试试吧"
|
|
102
|
|
- // ctl.shareImgUrlThumb = datas[currentPhotoIndex].photo_thumbnail_url
|
|
103
|
|
- // ctl.shareUrl = datas[currentPhotoIndex].photo_share_url
|
|
104
|
|
- presentController(ctl)
|
|
|
100
|
+// let ctl = ShareViewController UIStoryboard.photoDetail.instantiateController(ShareViewController.self)
|
|
|
101
|
+// ctl.shareContent = "我使用拍爱分享了一张美图,你也快来试试吧"
|
|
|
102
|
+// // ctl.shareImgUrlThumb = datas[currentPhotoIndex].photo_thumbnail_url
|
|
|
103
|
+// // ctl.shareUrl = datas[currentPhotoIndex].photo_share_url
|
|
|
104
|
+// presentController(ctl)
|
|
105
|
105
|
}
|
|
106
|
106
|
|
|
107
|
107
|
@IBAction func comment() {
|
|
|
|
@@ -380,3 +380,9 @@ extension PhotoDetailViewController: UICollectionViewDelegateFlowLayout {
|
|
380
|
380
|
}
|
|
381
|
381
|
|
|
382
|
382
|
extension PhotoDetailViewController: NavigationBackViewController {}
|
|
|
383
|
+
|
|
|
384
|
+extension PhotoDetailViewController: Storyboarded {
|
|
|
385
|
+ static func instantiate() -> PhotoDetailViewController {
|
|
|
386
|
+ return UIStoryboard.photoDetail.instantiateViewController(type: PhotoDetailViewController.self)
|
|
|
387
|
+ }
|
|
|
388
|
+}
|
|
|
|
@@ -1,8 +1,8 @@
|
|
1
|
1
|
//
|
|
2
|
2
|
// PhotoPreviewViewController.swift
|
|
3
|
|
-// PaiAi
|
|
|
3
|
+// Paiai_iOS
|
|
4
|
4
|
//
|
|
5
|
|
-// Created by zhengjianfei on 16/4/9.
|
|
|
5
|
+// Created by FFIB on 16/4/9.
|
|
6
|
6
|
// Copyright © 2016年 FFIB. All rights reserved.
|
|
7
|
7
|
//
|
|
8
|
8
|
|
|
|
|
@@ -122,3 +122,9 @@ extension PhotoPreviewViewController: UICollectionViewDelegateFlowLayout {
|
|
122
|
122
|
return CGSize(width: collectionView.width, height: collectionView.height - 20)
|
|
123
|
123
|
}
|
|
124
|
124
|
}
|
|
|
125
|
+
|
|
|
126
|
+extension PhotoPreviewViewController: Storyboarded {
|
|
|
127
|
+ static func instantiate() -> PhotoPreviewViewController {
|
|
|
128
|
+ return UIStoryboard.photoDetail.instantiateViewController(type: PhotoPreviewViewController.self)
|
|
|
129
|
+ }
|
|
|
130
|
+}
|
|
|
|
@@ -1,8 +1,8 @@
|
|
1
|
1
|
//
|
|
2
|
2
|
// ShareViewController.swift
|
|
3
|
|
-// PaiAi
|
|
|
3
|
+// Paiai_iOS
|
|
4
|
4
|
//
|
|
5
|
|
-// Created by zhengjianfei on 16/4/7.
|
|
|
5
|
+// Created by FFIB on 16/4/7.
|
|
6
|
6
|
// Copyright © 2016年 FFIB. All rights reserved.
|
|
7
|
7
|
//
|
|
8
|
8
|
|
|
|
|
@@ -2,8 +2,8 @@
|
|
2
|
2
|
// Paiai_iOS.h
|
|
3
|
3
|
// Paiai_iOS
|
|
4
|
4
|
//
|
|
5
|
|
-// Created by ffib on 2018/12/19.
|
|
6
|
|
-// Copyright © 2018 yb. All rights reserved.
|
|
|
5
|
+// Created by FFIB on 2018/12/19.
|
|
|
6
|
+// Copyright © 2018 FFIB. All rights reserved.
|
|
7
|
7
|
//
|
|
8
|
8
|
|
|
9
|
9
|
#import <UIKit/UIKit.h>
|
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+//
|
|
|
2
|
+// BaseCoordinator.swift
|
|
|
3
|
+// Paiai_iOS
|
|
|
4
|
+//
|
|
|
5
|
+// Created by FFIB on 2019/4/29.
|
|
|
6
|
+// Copyright © 2019 FFIB. All rights reserved.
|
|
|
7
|
+//
|
|
|
8
|
+
|
|
|
9
|
+import RxSwift
|
|
|
10
|
+import Foundation
|
|
|
11
|
+
|
|
|
12
|
+public class BaseCoordinator<ResultType> {
|
|
|
13
|
+
|
|
|
14
|
+ typealias CoordinationResult = ResultType
|
|
|
15
|
+
|
|
|
16
|
+ let disposeBag = DisposeBag()
|
|
|
17
|
+ let didCancel = PublishSubject<Void>()
|
|
|
18
|
+
|
|
|
19
|
+ private let identifier = UUID()
|
|
|
20
|
+ private var childCoordinators = [UUID: Any]()
|
|
|
21
|
+
|
|
|
22
|
+ private func store<T>(coordinator: BaseCoordinator<T>) {
|
|
|
23
|
+ childCoordinators[coordinator.identifier] = coordinator
|
|
|
24
|
+ }
|
|
|
25
|
+
|
|
|
26
|
+ private func free<T>(coordinator: BaseCoordinator<T>) {
|
|
|
27
|
+ childCoordinators[coordinator.identifier] = nil
|
|
|
28
|
+ }
|
|
|
29
|
+
|
|
|
30
|
+ func coordinate<T>(to coordinator: BaseCoordinator<T>) -> Observable<T> {
|
|
|
31
|
+ store(coordinator: coordinator)
|
|
|
32
|
+ return coordinator.start()
|
|
|
33
|
+ .do(onNext: { [weak self] _ in
|
|
|
34
|
+ self?.free(coordinator: coordinator)
|
|
|
35
|
+ })
|
|
|
36
|
+ }
|
|
|
37
|
+
|
|
|
38
|
+ func start() -> Observable<ResultType> {
|
|
|
39
|
+ fatalError("Start method should be implemented.")
|
|
|
40
|
+ }
|
|
|
41
|
+}
|
|
|
|
@@ -1,8 +1,8 @@
|
|
1
|
1
|
//
|
|
2
|
2
|
// UIImageView+Kingfisher.swift
|
|
3
|
|
-// PaiAi
|
|
|
3
|
+// Paiai_iOS
|
|
4
|
4
|
//
|
|
5
|
|
-// Created by mac on 16/7/21.
|
|
|
5
|
+// Created by FFIB on 16/7/21.
|
|
6
|
6
|
// Copyright © 2016年 FFIB. All rights reserved.
|
|
7
|
7
|
//
|
|
8
|
8
|
|
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+//
|
|
|
2
|
+// NavigationSource.swift
|
|
|
3
|
+// Paiai_iOS
|
|
|
4
|
+//
|
|
|
5
|
+// Created by ffib on 2019/5/5.
|
|
|
6
|
+// Copyright © 2019 FFIB. All rights reserved.
|
|
|
7
|
+//
|
|
|
8
|
+
|
|
|
9
|
+import Foundation
|
|
|
10
|
+
|
|
|
11
|
+enum NavigationSource {}
|