|
@@ -21,8 +21,6 @@ class CommunityListViewController: UIViewController {
|
|
|
|
|
|
var communityListVCType : CommunityListVCType!
|
|
|
var cellHeightsDictionary = Dictionary<IndexPath, Any>()
|
|
|
- var cellHeightsFooterDictionary = Dictionary<Int, Any>()
|
|
|
- var cellHeightsHeaderDictionary = Dictionary<Int, Any>()
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
@@ -72,9 +70,6 @@ class CommunityListViewController: UIViewController {
|
|
|
tableView.backgroundColor = kf7f8faColor
|
|
|
tableView.dataSource = self
|
|
|
tableView.delegate = self
|
|
|
-// tableView.estimatedRowHeight = 0
|
|
|
-// tableView.estimatedSectionHeaderHeight = 0
|
|
|
-// tableView.estimatedSectionFooterHeight = 0
|
|
|
return tableView
|
|
|
}()
|
|
|
|
|
@@ -106,7 +101,7 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
switch communityListVCType {
|
|
|
case .follow?:
|
|
|
if section >= 8 {
|
|
|
- return 3
|
|
|
+ return 6
|
|
|
}else {
|
|
|
return 1
|
|
|
}
|
|
@@ -189,6 +184,31 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
cell.cardContentTitleTableViewCellType = .noTitleMoreThan
|
|
|
return cell
|
|
|
+ case 3:
|
|
|
+ let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.collectClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+ }
|
|
|
+ cell.praiseClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return cell
|
|
|
+ case 4:
|
|
|
+ let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.frame = tableView.bounds
|
|
|
+ cell.layoutIfNeeded()
|
|
|
+ cell.reloadData()
|
|
|
+ return cell
|
|
|
+ case 5:
|
|
|
+ let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.addCommnetClosureName = {
|
|
|
+
|
|
|
+ }
|
|
|
+ return cell
|
|
|
default:
|
|
|
return UITableViewCell()
|
|
|
}
|
|
@@ -210,6 +230,31 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
cell.cardContentTitleTableViewCellType = .noTitleNoMoreThan
|
|
|
return cell
|
|
|
+ case 3:
|
|
|
+ let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.collectClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+ }
|
|
|
+ cell.praiseClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return cell
|
|
|
+ case 4:
|
|
|
+ let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.frame = tableView.bounds
|
|
|
+ cell.layoutIfNeeded()
|
|
|
+ cell.reloadData()
|
|
|
+ return cell
|
|
|
+ case 5:
|
|
|
+ let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.addCommnetClosureName = {
|
|
|
+
|
|
|
+ }
|
|
|
+ return cell
|
|
|
default:
|
|
|
return UITableViewCell()
|
|
|
}
|
|
@@ -231,6 +276,31 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
cell.cardContentTitleTableViewCellType = .titleMoreThan
|
|
|
|
|
|
+ return cell
|
|
|
+ case 3:
|
|
|
+ let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.collectClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+ }
|
|
|
+ cell.praiseClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return cell
|
|
|
+ case 4:
|
|
|
+ let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.frame = tableView.bounds
|
|
|
+ cell.layoutIfNeeded()
|
|
|
+ cell.reloadData()
|
|
|
+ return cell
|
|
|
+ case 5:
|
|
|
+ let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.addCommnetClosureName = {
|
|
|
+
|
|
|
+ }
|
|
|
return cell
|
|
|
default:
|
|
|
return UITableViewCell()
|
|
@@ -253,6 +323,30 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
cell.cardContentTitleTableViewCellType = .titleNoMoreThan
|
|
|
return cell
|
|
|
+ case 3:
|
|
|
+ let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.collectClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+ }
|
|
|
+ cell.praiseClosureName = {
|
|
|
+ (button:UIButton) -> Bool in
|
|
|
+ return !button.isSelected
|
|
|
+ }
|
|
|
+
|
|
|
+ return cell
|
|
|
+ case 4:
|
|
|
+ let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.frame = tableView.frame
|
|
|
+ cell.layoutIfNeeded()
|
|
|
+ cell.reloadData()
|
|
|
+ return cell
|
|
|
+ case 5:
|
|
|
+ let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.addCommnetClosureName = {
|
|
|
+
|
|
|
+ }
|
|
|
+ return cell
|
|
|
default:
|
|
|
return UITableViewCell()
|
|
|
}
|
|
@@ -296,6 +390,12 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
return 80
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
default:
|
|
|
return 0
|
|
|
}
|
|
@@ -305,6 +405,12 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
return 80
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
default:
|
|
|
return 0
|
|
|
}
|
|
@@ -314,6 +420,12 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
return 80
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
default:
|
|
|
return 0
|
|
|
}
|
|
@@ -323,6 +435,12 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
return 80
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
default:
|
|
|
return 0
|
|
|
}
|
|
@@ -420,7 +538,6 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
// }
|
|
|
// return 0
|
|
|
// }
|
|
|
-
|
|
|
|
|
|
|
|
|
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
|