Skip to content

Commit d0e6b66

Browse files
committed
退出代码查看 - bugfix
1 parent a1ec93d commit d0e6b66

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

Coding_iOS/Controllers/CodeListViewController.m

+4-10
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,10 @@ - (void)rightNavBtnClicked{
5555
break;
5656
case 1:{
5757
[weakSelf.navigationController.viewControllers enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(UIViewController *obj, NSUInteger idx, BOOL *stop) {
58-
if (![obj isKindOfClass:[weakSelf class]]) {
59-
if ([obj isKindOfClass:[ProjectViewController class]]) {
60-
if ([(ProjectViewController *)obj curType] != ProjectViewTypeCodes) {
61-
*stop = YES;
62-
}
63-
}else{
64-
*stop = YES;
65-
}
66-
}
67-
if (*stop) {
58+
if (![obj isKindOfClass:[CodeViewController class]] &&
59+
![obj isKindOfClass:[CodeListViewController class]] &&
60+
!([obj isKindOfClass:[ProjectViewController class]] && [(ProjectViewController *)obj curType] == ProjectViewTypeCodes)) {
61+
*stop = YES;
6862
[weakSelf.navigationController popToViewController:obj animated:YES];
6963
}
7064
}];

Coding_iOS/Controllers/CodeViewController.m

+5-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "WebContentManager.h"
1212
#import "ProjectCommitsViewController.h"
1313
#import "ProjectViewController.h"
14+
#import "CodeListViewController.h"
1415

1516
@interface CodeViewController ()
1617
@property (strong, nonatomic) UIWebView *webContentView;
@@ -158,16 +159,10 @@ - (void)rightNavBtnClicked{
158159
break;
159160
case 1:{
160161
[weakSelf.navigationController.viewControllers enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(UIViewController *obj, NSUInteger idx, BOOL *stop) {
161-
if (![obj isKindOfClass:[weakSelf class]]) {
162-
if ([obj isKindOfClass:[ProjectViewController class]]) {
163-
if ([(ProjectViewController *)obj curType] != ProjectViewTypeCodes) {
164-
*stop = YES;
165-
}
166-
}else{
167-
*stop = YES;
168-
}
169-
}
170-
if (*stop) {
162+
if (![obj isKindOfClass:[CodeViewController class]] &&
163+
![obj isKindOfClass:[CodeListViewController class]] &&
164+
!([obj isKindOfClass:[ProjectViewController class]] && [(ProjectViewController *)obj curType] == ProjectViewTypeCodes)) {
165+
*stop = YES;
171166
[weakSelf.navigationController popToViewController:obj animated:YES];
172167
}
173168
}];

0 commit comments

Comments
 (0)