|
@@ -89,7 +89,7 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
func numberOfSections(in tableView: UITableView) -> Int {
|
|
|
switch communityListVCType {
|
|
|
case .follow?:
|
|
|
- return 12
|
|
|
+ return 23
|
|
|
case .recommend?:
|
|
|
return 0
|
|
|
default:
|
|
@@ -178,7 +178,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
}
|
|
|
return cell
|
|
|
case 1:
|
|
|
- let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 100
|
|
|
+ cardContentPicVideoModel.height = 200
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
return cell
|
|
|
case 2:
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
@@ -224,7 +230,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
}
|
|
|
return cell
|
|
|
case 1:
|
|
|
- let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 100
|
|
|
+ cardContentPicVideoModel.height = 300
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
return cell
|
|
|
case 2:
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
@@ -270,7 +282,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
}
|
|
|
return cell
|
|
|
case 1:
|
|
|
- let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 200
|
|
|
+ cardContentPicVideoModel.height = 200
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
return cell
|
|
|
case 2:
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
@@ -317,7 +335,574 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
}
|
|
|
return cell
|
|
|
case 1:
|
|
|
- let cell = CardContentPicTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 200
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 12:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 13:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 2
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 14:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 3
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 15:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 4
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 16:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 5
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 17:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 6
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 18:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 7
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 19:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 8
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 20:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 9
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 21:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 100
|
|
|
+ cardContentPicVideoModel.height = 300
|
|
|
+ cardContentPicVideoModel.picAndVideo = 1
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
+ return cell
|
|
|
+ case 2:
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ case 22:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ cell.followType = .mutualFollow
|
|
|
+ //关注状态
|
|
|
+ cell.followClosure = {
|
|
|
+ [weak self] in
|
|
|
+ self?.followData(indexPath: indexPath)
|
|
|
+ }
|
|
|
+ return cell
|
|
|
+ case 1:
|
|
|
+ let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 1
|
|
|
+ cell.cardContentPicVideoModel = cardContentPicVideoModel
|
|
|
return cell
|
|
|
case 2:
|
|
|
let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
@@ -388,6 +973,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
switch indexPath.row {
|
|
|
case 0:
|
|
|
return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 100
|
|
|
+ cardContentPicVideoModel.height = 200
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
case 3:
|
|
@@ -403,6 +995,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
switch indexPath.row {
|
|
|
case 0:
|
|
|
return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 100
|
|
|
+ cardContentPicVideoModel.height = 300
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
case 3:
|
|
@@ -418,6 +1017,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
switch indexPath.row {
|
|
|
case 0:
|
|
|
return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 200
|
|
|
+ cardContentPicVideoModel.height = 200
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
case 3:
|
|
@@ -433,6 +1039,255 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
switch indexPath.row {
|
|
|
case 0:
|
|
|
return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 200
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 12:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 13:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 2
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 14:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 3
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 15:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 4
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 16:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 5
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 17:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 6
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 18:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 7
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 19:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 8
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 20:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 9
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 0
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 21:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 9
|
|
|
+ cardContentPicVideoModel.width = 100
|
|
|
+ cardContentPicVideoModel.height = 300
|
|
|
+ cardContentPicVideoModel.picAndVideo = 1
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
+ case 2:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 3:
|
|
|
+ return 54
|
|
|
+ case 4:
|
|
|
+ return UITableView.automaticDimension
|
|
|
+ case 5:
|
|
|
+ return 74
|
|
|
+ default:
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ case 22:
|
|
|
+ switch indexPath.row {
|
|
|
+ case 0:
|
|
|
+ return 80
|
|
|
+ case 1:
|
|
|
+ let cardContentPicVideoModel = CardContentPicVideoModel()
|
|
|
+ cardContentPicVideoModel.number = 1
|
|
|
+ cardContentPicVideoModel.width = 300
|
|
|
+ cardContentPicVideoModel.height = 100
|
|
|
+ cardContentPicVideoModel.picAndVideo = 1
|
|
|
+ return cardContentPicVideoModel.collectionViewHeight() + 20
|
|
|
case 2:
|
|
|
return UITableView.automaticDimension
|
|
|
case 3:
|
|
@@ -508,13 +1363,6 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
cellHeightsDictionary.updateValue(cell.frame.size.height, forKey: indexPath)
|
|
|
}
|
|
|
|
|
|
-// func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) {
|
|
|
-// cellHeightsFooterDictionary.updateValue(view.frame.size.height, forKey: section)
|
|
|
-// }
|
|
|
-// func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
|
|
|
-// cellHeightsHeaderDictionary.updateValue(view.frame.size.height, forKey: section)
|
|
|
-// }
|
|
|
-
|
|
|
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
|
|
|
let height = cellHeightsDictionary[indexPath]
|
|
|
if let height = height {
|
|
@@ -523,6 +1371,13 @@ extension CommunityListViewController : UITableViewDelegate,UITableViewDataSourc
|
|
|
return UITableView.automaticDimension
|
|
|
}
|
|
|
|
|
|
+// func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) {
|
|
|
+// cellHeightsFooterDictionary.updateValue(view.frame.size.height, forKey: section)
|
|
|
+// }
|
|
|
+// func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
|
|
|
+// cellHeightsHeaderDictionary.updateValue(view.frame.size.height, forKey: section)
|
|
|
+// }
|
|
|
+
|
|
|
// func tableView(_ tableView: UITableView, estimatedHeightForHeaderInSection section: Int) -> CGFloat {
|
|
|
// let height = cellHeightsHeaderDictionary[section]
|
|
|
// if let height = height {
|