33 42
 }
34 43
 
35 44
 fileprivate extension MineAboutViewController {
@@ -42,7 +51,7 @@ fileprivate extension MineAboutViewController {
42 51
     func bindGestureToContactUsAction() {
43 52
         contactUsBtn.rx.tap
44 53
             .asObservable()
45
-            .subscribe { (_) in
54
+            .subscribe { [unowned self] _ in
46 55
                 let webVC = WebViewController(title: "联系我们",
47 56
                                               path: "https://pai.ai/page/contact_us")
48 57
                 self.navigationController?.pushViewController(webVC)
@@ -52,7 +61,7 @@ fileprivate extension MineAboutViewController {
52 61
     func bindGestureToScoreAction() {
53 62
         scoreBtn.rx.tap
54 63
             .asObservable()
55
-            .subscribe { (_) in
64
+            .subscribe {  _ in
56 65
                 guard let url = URL(string: "https://itunes.apple.com/cn/app/pai-aipaiai/id1163960351?mt=8") else {
57 66
                     return
58 67
                 }
@@ -63,7 +72,7 @@ fileprivate extension MineAboutViewController {
63 72
     func bindGestureToUserAgreementAction() {
64 73
         userAgreementBtn.rx.tap
65 74
             .asObservable()
66
-            .subscribe { (_) in
75
+            .subscribe { [unowned self] _ in
67 76
                 let webVC = WebViewController(title: "用户协议",
68 77
                                               path: "https://pai.ai/page/user_agreement")
69 78
                 self.navigationController?.pushViewController(webVC)
@@ -78,3 +87,4 @@ extension MineAboutViewController: Storyboarded {
78 87
         return UIStoryboard.mine.instantiateViewController(type: MineAboutViewController.self)
79 88
     }
80 89
 }
90
+

+ 5 - 7
PaiAi/Paiai_iOS/App/Mine/MineCoordinator.swift

@@ -25,8 +25,6 @@ class MineCoordinator: BaseCoordinator<Void> {
25 25
         mineViewController.delegate = self
26 26
         return didCancel
27 27
     }
28
-
29
-    override func listenDeallocate() {}
30 28
 }
31 29
 
32 30
 extension MineCoordinator: MineViewControllerDelegate {
@@ -46,7 +44,7 @@ extension MineCoordinator: MineViewControllerDelegate {
46 44
 
47 45
     func didSelect(_ item: MineItem) {
48 46
         mineViewController.dismissController()
49
-
47
+        deallocatedDispose.dispose()
50 48
         let vc: UIViewController
51 49
         switch item {
52 50
         case .group:
@@ -58,8 +56,8 @@ extension MineCoordinator: MineViewControllerDelegate {
58 56
         case .about:
59 57
             vc = makeMineAboutViewController()
60 58
         }
61
-
62
-        vc.rx.deallocated.subscribe(onNext: { _ in
59
+        
60
+        vc.rx.deallocating.subscribe(onNext: { _ in
63 61
             self.didCancel.onNext(())
64 62
         }).disposed(by: disposeBag)
65 63
     }
@@ -103,8 +101,8 @@ fileprivate extension MineCoordinator {
103 101
 
104 102
     func makeMineAboutViewController() -> MineAboutViewController {
105 103
         let vc = MineAboutViewController.instantiate()
106
-        navigationController.pushViewController(vc)
107
-
104
+        navigationController.pushViewController(vc, animated: true)
105
+        print(navigationController)
108 106
         return vc
109 107
     }
110 108
 

+ 10 - 11
PaiAi/Paiai_iOS/Reusable/BaseCoordinator.swift

@@ -7,7 +7,7 @@
7 7
 //
8 8
 
9 9
 import RxSwift
10
-import Foundation
10
+import UIKit
11 11
 
12 12
 public class BaseCoordinator<ResultType> {
13 13
 
@@ -15,6 +15,7 @@ public class BaseCoordinator<ResultType> {
15 15
 
16 16
     let disposeBag = DisposeBag()
17 17
     var didCancel = PublishSubject<Void>()
18
+    var deallocatedDispose = Disposables.create()
18 19
     var navigationController: UINavigationController
19 20
     var viewController: UIViewController
20 21
 
@@ -25,7 +26,13 @@ public class BaseCoordinator<ResultType> {
25 26
     init(navigationController: UINavigationController, viewController: UIViewController) {
26 27
         self.viewController = viewController
27 28
         self.navigationController = navigationController
28
-        listenDeallocate()
29
+        
30
+        deallocatedDispose = viewController.rx.viewDidDisappear.subscribe(onNext: {[weak self] _ in
31
+            guard let `self` = self else { return }
32
+            if !self.navigationController.viewControllers.contains(viewController) {
33
+                self.didCancel.onNext(())
34
+            }
35
+        })
29 36
     }
30 37
 
31 38
     private func store<T>(coordinator: BaseCoordinator<T>) {
@@ -33,6 +40,7 @@ public class BaseCoordinator<ResultType> {
33 40
     }
34 41
 
35 42
     private func free<T>(coordinator: BaseCoordinator<T>) {
43
+        print(coordinator)
36 44
         childCoordinators[coordinator.identifier] = nil
37 45
     }
38 46
 
@@ -48,13 +56,4 @@ public class BaseCoordinator<ResultType> {
48 56
     func start() -> Observable<ResultType> {
49 57
         fatalError("Start method should be implemented.")
50 58
     }
51
-
52
-    func listenDeallocate() {
53
-        navigationController.rx.willShow.subscribe(onNext: {[weak self] (_, _) in
54
-            guard let `self` = self else { return }
55
-            if !self.navigationController.viewControllers.contains(self.viewController) {
56
-                self.didCancel.onNext(())
57
-            }
58
-        }).disposed(by: disposeBag)
59
-    }
60 59
 }

kodo - Gogs: Go Git Service

Aucune description

Brightcells: 66a598b30c Makemigrations 8 ans auparavant
..
0001_initial.py e184e7dd5b add api group_create/group_join 11 ans auparavant
0002_groupinfo_session_id.py e184e7dd5b add api group_create/group_join 11 ans auparavant
0003_groupinfo_admin_id.py 7e305483ab add api group_detail/group_lock/group_pass/group_refuse 11 ans auparavant
0004_auto_20151216_2337.py 7467a3e68a add api group_update/group_remove 11 ans auparavant
0005_groupuserinfo_current_id.py f587f0a48f user can just see photo after he joined the group & zh_Hans replace zh_CN in settings.py 11 ans auparavant
0006_groupuserinfo_avatar.py 4afdb94e20 add avatar for GroupUserInfo 11 ans auparavant
0007_auto_20160112_2040.py df1df69fe3 add api upgrade/splash 10 ans auparavant
0008_photocommentinfo.py c72d89f6e5 add api comment_submit_api/comment_list_api/thumbup_submit_api/thumbup_list_api/thumbup_cancel_api 10 ans auparavant
0009_photothumbupinfo.py c72d89f6e5 add api comment_submit_api/comment_list_api/thumbup_submit_api/thumbup_list_api/thumbup_cancel_api 10 ans auparavant
0010_auto_20160120_1830.py a121b75ff2 add db_index=True for status field 10 ans auparavant
0011_auto_20160302_2048.py da2a81fff1 add api pai2_home 10 ans auparavant
0012_groupinfo_group_avatar.py da2a81fff1 add api pai2_home 10 ans auparavant
0013_groupinfo_group_default_avatar.py f6a88c632b add group_default_avatar field for GroupInfo 10 ans auparavant
0014_auto_20160308_2347.py ca727b0362 store/return w/h for photo 10 ans auparavant
0015_groupphotoinfo_avatar.py 88049b12db store/return more field for photo 10 ans auparavant
0016_auto_20160321_1535.py 537bd9bd41 add api group_quit_api 10 ans auparavant
0017_groupphotoinfo_photo_from.py dbea356558 add photo_from field for GroupPhotoInfo and return photo_from for some api 10 ans auparavant
0018_auto_20160417_2246.py d64b3c216b add and return photo_thumbnail2 relative 10 ans auparavant
0019_auto_20160422_1322.py 102152ca4a add api lensman_photo_bought & modify api wx_order_create_api and adjust return field 10 ans auparavant
0020_groupphotoinfo_session_id.py 102152ca4a add api lensman_photo_bought & modify api wx_order_create_api and adjust return field 10 ans auparavant
0021_photocommentinfo_to_uid.py fa36c26ce4 extend param to_uid for comment_submit_api 10 ans auparavant
0022_auto_20160901_1439.py 6199c8f7ad add api lensman_origin_wanted_api/lensman_origin_photo_upload_api 10 ans auparavant
0023_groupinfo_group_initio.py e06dc10006 Make join session group by scan group qrcode fetch group photos initio 10 ans auparavant
0024_auto_20161214_1329.py f724e0f9c0 Add tour guide apis 10 ans auparavant
0025_auto_20161214_1659.py ad69866b26 Add tour guide's name and phone in GroupInfo 10 ans auparavant
0026_auto_20161216_1301.py 034acddb68 Add total_persons for GroupInfo 10 ans auparavant
0027_groupuserinfo_authority.py 88f0697a89 Add authority field for GroupUserInfo 10 ans auparavant
0028_auto_20161220_1815.py 272f181c50 Makemigrations 10 ans auparavant
0029_auto_20161224_1616.py 564ff620d7 Add unique_together = (('group_id', 'user_id'),) for GroupUserInfo 10 ans auparavant
0030_groupinfo_gather_location.py 90d377ee6e Add gather location 9 ans auparavant
0031_groupphotoinfo_photo_md5.py d824fbd441 Add photo_md5 for GroupPhotoInfo 9 ans auparavant
0032_groupinfo_gather_screenshot.py e8cd9652b7 Add gather_screenshot for api tg_group_gather_start_api 9 ans auparavant
0033_groupphotoinfo_photo_id.py 3c6e34823b Add photo_id for GroupPhotoInfo replaced pk 9 ans auparavant
0034_auto_20170411_1156.py 14d5d63e3b Add nomark/origin price for GroupPhotoInfo 9 ans auparavant
0035_groupuserinfo_admin_status.py 9e4ac4fd3b Add admin_status for GroupUserInfo 9 ans auparavant
0036_groupphotoinfo_has_watermark.py 3b92e37156 Add field has_watermark for GroupPhotoInfo 9 ans auparavant
0037_auto_20170821_1600.py bf678fc740 Add unique_together = (('session_id', 'group_from'),) 9 ans auparavant
0038_auto_20170821_1608.py 7060597dd6 Add unique_together = (('group_id', 'user_id', 'photo_md5'),) for GroupPhotoInfo 9 ans auparavant
0039_auto_20170821_1613.py 9f4c919c29 Add unique_together = (('photo_id', 'user_id'),) for PhotoThumbUpInfo 9 ans auparavant
0040_auto_20170825_1342.py e5ad69259f Add unique_together = (('group_id', 'session_id', 'user_id', 'photo_id', 'lensman_photo_id'),) for GroupPhotoOrderInfo 9 ans auparavant
0041_auto_20170825_1342.py e5ad69259f Add unique_together = (('group_id', 'session_id', 'user_id', 'photo_id', 'lensman_photo_id'),) for GroupPhotoOrderInfo 9 ans auparavant
0042_groupphotoinfo_lensman_type.py a6195fa70d Add outtake lensman 9 ans auparavant
0043_auto_20180101_2220.py 9bb56c50cc Makemigrations 8 ans auparavant
0044_auto_20180103_0446.py a7cbbf15a7 Update max_length for CharField 8 ans auparavant
0045_auto_20180930_1159.py 66a598b30c Makemigrations 8 ans auparavant
__init__.py e184e7dd5b add api group_create/group_join 11 ans auparavant
kodo - Gogs: Go Git Service

Нет описания

Brightcells: b90ee8e884 list_filter sr_id лет %!s(int64=7): %!d(string=назад)
..
migrations 9db41fee66 default False лет %!s(int64=7): %!d(string=назад)
__init__.py aa31a5f59a Add kodo лет %!s(int64=8): %!d(string=назад)
admin.py b90ee8e884 list_filter sr_id лет %!s(int64=7): %!d(string=назад)
apps.py aa31a5f59a Add kodo лет %!s(int64=8): %!d(string=назад)
models.py dfca004d3e Opt лет %!s(int64=7): %!d(string=назад)
tests.py aa31a5f59a Add kodo лет %!s(int64=8): %!d(string=назад)
views.py aa31a5f59a Add kodo лет %!s(int64=8): %!d(string=назад)