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