Skip to content

Commit 03fda23

Browse files
committed
没有文件的文件夹,不需要 编辑 按钮
1 parent abfd76d commit 03fda23

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Coding_iOS/Controllers/FileListViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ - (void)viewDidLoad
7777

7878
__weak typeof(self) weakSelf = self;
7979

80-
self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithBtnTitle:@"编辑" target:self action:@selector(changeEditState)];
81-
8280
[[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kNotificationUploadCompled object:nil] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(NSNotification *aNotification) {
8381
//{NSURLResponse: response, NSError: error, ProjectFile: data}
8482
NSDictionary* userInfo = [aNotification userInfo];
@@ -100,7 +98,6 @@ - (void)changeEditState{
10098
rightBarButtonItems = @[item1];
10199
}
102100
[self.navigationItem setRightBarButtonItems:rightBarButtonItems animated:YES];
103-
// [self.navigationItem.rightBarButtonItem setTitle:_myTableView.isEditing? @"完成": @"编辑"];
104101
[self configToolBar];
105102
[self.myTableView performSelector:@selector(reloadData) withObject:nil afterDelay:0.3];
106103
}
@@ -264,6 +261,9 @@ - (void)sendRequestFileList{
264261
[weakSelf.view endLoading];
265262
if (data) {
266263
weakSelf.myFiles = data;
264+
265+
self.navigationItem.rightBarButtonItem = weakSelf.myFiles.list.count > 0? [UIBarButtonItem itemWithBtnTitle:@"编辑" target:self action:@selector(changeEditState)]: nil;
266+
267267
[weakSelf.myTableView reloadData];
268268
}
269269
[weakSelf.view configBlankPage:EaseBlankPageTypeView hasData:([weakSelf totalDataRow] > 0) hasError:(error != nil) reloadButtonBlock:^(id sender) {

0 commit comments

Comments
 (0)