Commit 3e3aedfd87258ff290a32adba4b6c4e711e2e386
1 parent
0ff55856
提交排序通知修改
Showing
3 changed files
with
12 additions
and
1 deletions
metaCode/Classes/Config/CNLiveConfigManager.swift
| ... | ... | @@ -54,6 +54,8 @@ extension Notification.Name { |
| 54 | 54 | public static let StandAuthNotificationSuccess = Notification.Name("StandAuthNotificationSuccess") |
| 55 | 55 | //认证身份失败通知 |
| 56 | 56 | public static let StandAuthNotificationUnSuccess = Notification.Name("StandAuthNotificationUnSuccess") |
| 57 | + //认证身份排序通知 | |
| 58 | + public static let StandAuthSortNotificationResult = Notification.Name("StandAuthSortNotificationResult") | |
| 57 | 59 | } |
| 58 | 60 | struct NetworkStatus { |
| 59 | 61 | //无网状态通知 | ... | ... |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAddInfoViewController.swift
| ... | ... | @@ -68,15 +68,23 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel |
| 68 | 68 | return copyButton |
| 69 | 69 | }() |
| 70 | 70 | |
| 71 | + var is_sort: Bool! | |
| 71 | 72 | var pageNum: NSInteger |
| 72 | 73 | var network_type: CNLiveMineResponseType! |
| 73 | 74 | var _show_type:CNLiveMineInfoShowType! |
| 74 | 75 | init(show_type:CNLiveMineInfoShowType) { |
| 76 | + self.is_sort = false | |
| 75 | 77 | self.pageNum = 1 |
| 76 | 78 | super.init(nibName:nil, bundle:nil) |
| 77 | 79 | _show_type = show_type |
| 78 | 80 | } |
| 79 | 81 | |
| 82 | + override func viewWillDisappear(_ animated: Bool) { | |
| 83 | + super.viewWillDisappear(animated) | |
| 84 | + if self.is_sort { | |
| 85 | + NotificationCenter.default.post(name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil) | |
| 86 | + } | |
| 87 | + } | |
| 80 | 88 | |
| 81 | 89 | required init?(coder: NSCoder) { |
| 82 | 90 | fatalError("init(coder:) has not been implemented") |
| ... | ... | @@ -336,13 +344,13 @@ extension CNLiveMineAddInfoViewController { |
| 336 | 344 | func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, |
| 337 | 345 | to destinationIndexPath: IndexPath) { |
| 338 | 346 | objc_sync_enter(self) |
| 347 | + is_sort = true | |
| 339 | 348 | swap(&dataArray[sourceIndexPath.row], &dataArray[destinationIndexPath.row]) |
| 340 | 349 | let tempArray = NSMutableArray() |
| 341 | 350 | for model in dataArray { |
| 342 | 351 | let m = model as! MineAuthListModel |
| 343 | 352 | tempArray.add(m.identityId) |
| 344 | 353 | } |
| 345 | - print("索引存储的key=>\(tempArray)") | |
| 346 | 354 | StandSortManager.insertSortData(indexs: tempArray) |
| 347 | 355 | objc_sync_exit(self) |
| 348 | 356 | } | ... | ... |
metaCode/Classes/Main/MinePage/View/CNLiveMineBodyListView.swift
| ... | ... | @@ -75,6 +75,7 @@ class MineBodyOneListViewCell : UITableViewCell { |
| 75 | 75 | if tempArray.count == 0 { |
| 76 | 76 | tipLabel.isHidden = false |
| 77 | 77 | }else{ |
| 78 | + tipLabel.isHidden = true | |
| 78 | 79 | for (index, item) in tempArray.enumerated() { |
| 79 | 80 | setupWithIconsView(authModel: item, index: index) |
| 80 | 81 | } | ... | ... |