123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640 |
- //
- // CommunityListViewController.swift
- // RainbowPlanet
- //
- // Created by 南鑫林 on 2019/6/11.
- // Copyright © 2019 RainbowPlanet. All rights reserved.
- //
- import UIKit
- import JXSegmentedView
- class CommunityFollowViewController: UIViewController {
-
- deinit {
- if observe != nil {
- NotificationCenter.default.removeObserver(observe!)
- }
- }
- weak var observe : NSObjectProtocol?
-
- var cellHeightsDictionary = Dictionary<IndexPath, Any>()
- var communityFollowDataModels = Array<CommunityFollowDataModel>()
- var communityFollowDataModel : CommunityFollowDataModel?
- var keyBoardCommentView : KeyBoardCommentView?
- /// 关注数组
- var cmsMemberModels = Array<CMSMemberModel>()
-
- override func viewDidLoad() {
- super.viewDidLoad()
- setupViews()
- setupLayouts()
- setupData()
- }
-
- func setupViews() {
- view.backgroundColor = kf7f8faColor
- view.addSubview(tableView)
- }
-
- func setupLayouts() {
- tableView.snp.makeConstraints { (make) in
- make.top.left.right.equalToSuperview()
- make.height.equalTo(kScreenHeight-48-kNavBarTotalHeight-kTabBarTotalHeight)
- }
- }
-
- private lazy var tableView: UITableView = {
- let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
- tableView.separatorStyle = .none
- tableView.backgroundColor = kf7f8faColor
- tableView.dataSource = self
- tableView.delegate = self
- return tableView
- }()
-
- private lazy var followTableHeaderView: CommunityFollowTableHeaderView = {
- let followTableHeaderView = CommunityFollowTableHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 286))
- return followTableHeaderView
- }()
-
- func setupData() {
- //下拉刷新
- tableView.addHeaderWithHeader(withBeginRefresh: true, animation: false) {
- [weak self] (page) in
- self?.loadData(page:page)
- }
- tableView.addFooterWithWithHeader(withAutomaticallyRefresh: false) {
- [weak self] (page) in
- SwiftProgressHUD.shared().showWait()
- self?.communityFollowFeedApi(page: page)
- }
-
- observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("followApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
- let followStatusModel = notification.object as? FollowStatusModel
-
- if !(self?.cmsMemberModels.isEmpty ?? true) {
- for cmsMemberModel in (self?.cmsMemberModels)! {
- if cmsMemberModel.uid == followStatusModel?.uid {
- cmsMemberModel.followStatus = followStatusModel?.isFollowStatus
- }
- }
- }
-
- if !(self?.communityFollowDataModels.isEmpty ?? true) {
- for communityFollowDataModel in (self?.communityFollowDataModels)! {
- if communityFollowDataModel.relateData?.uid == followStatusModel?.uid {
- communityFollowDataModel.relateData?.isFollow = followStatusModel?.isFollowStatus
- }
- }
- }
-
- self?.tableView.reloadData()
- }
-
- observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("unlikeApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
- let followStatusModel = notification.object as? FollowStatusModel
- if !(self?.communityFollowDataModels.isEmpty ?? true) {
- for communityFollowDataModel in (self?.communityFollowDataModels)! {
- if communityFollowDataModel.relateData?.uid == followStatusModel?.uid {
- communityFollowDataModel.relateData?.isDislike = followStatusModel?.isFollowStatus
- }
- }
- }
- self?.tableView.reloadData()
- }
-
- observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("islikeApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
- let followStatusModel = notification.object as? FollowStatusModel
- if !(self?.communityFollowDataModels.isEmpty ?? true) {
- for communityFollowDataModel in (self?.communityFollowDataModels)! {
- if communityFollowDataModel.relateData?.uid == followStatusModel?.uid {
- communityFollowDataModel.relateData?.isLike = followStatusModel?.isFollowStatus
- }
- }
- }
- self?.tableView.reloadData()
- }
-
- observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("isCollectApi"), object: nil, queue: OperationQueue.main) { [weak self] (notification) in
- let followStatusModel = notification.object as? FollowStatusModel
- if !(self?.communityFollowDataModels.isEmpty ?? true) {
- for communityFollowDataModel in (self?.communityFollowDataModels)! {
- if communityFollowDataModel.relateData?.uid == followStatusModel?.uid {
- communityFollowDataModel.relateData?.isCollect = followStatusModel?.isFollowStatus
- }
- }
- }
- self?.tableView.reloadData()
- }
- }
-
- /// 显示键盘
- func showKeyBoardCommentView() {
- keyBoardCommentView = KeyBoardCommentView.keyBoardCommentView(sendClosure: {
- [weak self] text in
- self?.communityPostCommentApi(text: text, complete: {
- self?.keyBoardCommentView?.dismisskeyBoardCommentView()
- })
- })
- }
- /// 隐藏键盘
- func hiddenKeyBoardCommentView() {
- keyBoardCommentView?.hiddenViewClosure = {
- [weak self] in
- self?.communityFollowDataModel = nil
- }
- }
- }
- extension CommunityFollowViewController {
-
- /// 加载首页数据
- ///
- /// - Parameter page: <#page description#>
- func loadData(page:Int) {
- SwiftProgressHUD.shared().showWait()
-
- //获取系统存在的全局队列
- let queue = DispatchQueue.global(qos: .default)
- //定义一个group
- let group = DispatchGroup()
- //并发任务,顺序执行
- queue.async(group: group) { [weak self] in
- self?.cmsMemberListApi()
-
- }
- queue.async(group: group) { [weak self] in
- self?.communityFollowFeedApi(page: page)
- }
- }
-
- /// 获取关注用户列表
- func cmsMemberListApi() {
- SwiftMoyaNetWorkServiceCMS.shared().cmsMemberListApi(takeCount: 20) {
- [weak self] (cmsMemberListModel) -> (Void) in
- let cmsMemberListModel = cmsMemberListModel as? CMSMemberListModel
- self?.cmsMemberModels = (cmsMemberListModel?.list)!
- self?.tableView.reloadData()
- SwiftProgressHUD.shared().hide()
- }
- }
-
- /// 关注feed流
- ///
- /// - Parameter page: 分页
- func communityFollowFeedApi(page:Int) {
- SwiftMoyaNetWorkServiceCommunity.shared().communityFollowFeedApi(page:page) {
- [weak self] (communityFollowFeedModel) -> (Void) in
- let communityFollowFeedModel = communityFollowFeedModel as? CommunityFollowFeedModel
- if communityFollowFeedModel?.pagination?.currentPage ?? 1 <= communityFollowFeedModel?.pagination?.totalPages ?? 1 {
- if communityFollowFeedModel?.pagination?.currentPage == 1{
- self?.communityFollowDataModels.removeAll()
- }
- self?.communityFollowDataModels = (self?.communityFollowDataModels)! + (communityFollowFeedModel?.data!)!
- if (self?.communityFollowDataModels.isEmpty)! {
- self?.tableView.tableHeaderView = self?.followTableHeaderView
- }
- self?.tableView.reloadData()
- SwiftProgressHUD.shared().hide()
- if self?.communityFollowDataModels.count ?? 0 >= communityFollowFeedModel?.pagination?.total ?? 0 {
- self?.tableView.endFooterNoMoreData()
- }
- }else {
- self?.tableView.endFooterNoMoreData()
- }
- }
- }
-
- /// 评论
- func communityPostCommentApi(text:String,complete:@escaping (() -> Void)) {
-
- let communityCustomCommnetModel = CommunityCustomCommnetModel()
- communityCustomCommnetModel.postId = self.communityFollowDataModel?.relateId ?? 0
- communityCustomCommnetModel.content = text
-
- SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentApi(communityCustomCommnetModel: communityCustomCommnetModel) {
- [weak self] (communityPostCommentIdModel) -> (Void) in
-
- let communityPostCommentIdModel = communityPostCommentIdModel as? CommunityPostCommentIdModel
-
- let communityFollowPostCommentModel = CommunityFollowPostCommentModel()
- communityFollowPostCommentModel.content = text
- communityFollowPostCommentModel.id = communityPostCommentIdModel?.id
- communityFollowPostCommentModel.username = UserModel.shared().getModel()?.username
-
- if self?.communityFollowDataModel?.relateData?.postComment?.isEmpty ?? true {
- self?.communityFollowDataModel?.relateData?.postComment = Array<CommunityFollowPostCommentModel>()
- }
-
- self?.communityFollowDataModel?.relateData?.postComment?.insert(communityFollowPostCommentModel, at: 0)
-
- VirusViewModel.shared.comment(communityFollowDataModel: self?.communityFollowDataModel, id: communityPostCommentIdModel?.id ?? 0)
- let count = 1 + (self?.communityFollowDataModel?.relateData?.commentCount ?? 0)
- self?.communityFollowDataModel?.relateData?.commentCount = count
- self?.tableView.reloadData()
- complete()
- }
- }
-
- }
- extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSource {
- func numberOfSections(in tableView: UITableView) -> Int {
- if communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- return 0
- }else if communityFollowDataModels.isEmpty && !cmsMemberModels.isEmpty {
- return 1
- }else if !communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- return communityFollowDataModels.isEmpty ? 0 : communityFollowDataModels.count
- }else {
- return communityFollowDataModels.count + 1
- }
- }
-
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- if communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- return 0
- }else if communityFollowDataModels.isEmpty && !cmsMemberModels.isEmpty {
- return 1
- }else if !communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- let communityFollowDataModel = communityFollowDataModels[section]
- if CommunityFollowType(rawValue:communityFollowDataModel.type ?? "1") == .post {
- return 6
- }else {
- return 1
- }
- }else {
- if section == 0 {
- return 1
- }else {
- let communityFollowDataModel = communityFollowDataModels[section - 1]
- if CommunityFollowType(rawValue: communityFollowDataModel.type ?? "1") == .post {
- return 6
- }else {
- return 1
- }
- }
- }
- }
-
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-
- if communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- return UITableViewCell()
- }else if communityFollowDataModels.isEmpty && !cmsMemberModels.isEmpty { //推荐关注
- let cell = CommunityRecommendFollowTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.type = .follow
- cell.cmsMemberModels = cmsMemberModels
- return cell
- }else if !communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty { //关注列表
- let communityFollowDataModel = communityFollowDataModels[indexPath.section]
- if CommunityFollowType(rawValue:communityFollowDataModel.type ?? "1") == .post { //帖子
- return postCell(indexPath: indexPath, communityFollowDataModel: communityFollowDataModel)
- }else { //关注
- let cell = CommunityFollowStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.followClosure = {
- [weak self] in
- CommunityFollowUserViewModel.shared.follow(communityFollowDataModel: communityFollowDataModel, communityFollowDataModels: (self?.communityFollowDataModels)!, tableView: (self?.tableView)!)
- }
- return cell
- }
-
- }else {
- if indexPath.section == 0 { //推荐关注
- let cell = CommunityRecommendFollowTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.type = .follow
- cell.cmsMemberModels = cmsMemberModels
- cell.followClosure = {
- [weak self] (isFollow,cmsMemberModel) in
- for (_,model) in (self?.communityFollowDataModels.enumerated())! {
- if model.relateData?.uid == cmsMemberModel.uid {
- model.relateData?.isFollow = isFollow
- tableView.reloadData()
- }
- }
- }
- return cell
- }else {//关注列表
- let communityFollowDataModel = communityFollowDataModels[indexPath.section - 1]
- if CommunityFollowType(rawValue: communityFollowDataModel.type ?? "1") == .post { //帖子
- return postCell(indexPath: indexPath, communityFollowDataModel: communityFollowDataModel)
-
- }else {//关注
- let cell = CommunityFollowStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.communityFollowDataModel = communityFollowDataModel
- cell.followClosure = {
- [weak self] in
- CommunityFollowUserViewModel.shared.follow(communityFollowDataModel: communityFollowDataModel, communityFollowDataModels: (self?.communityFollowDataModels)!, tableView: (self?.tableView)!)
- }
- return cell
- }
- }
- }
- }
-
- func postCell(indexPath:IndexPath,communityFollowDataModel:CommunityFollowDataModel) -> UITableViewCell {
- switch indexPath.row {
- //贴子用户
- case 0:
- let cell = CardContentUserTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.communityFollowDataModel = communityFollowDataModel
- cell.followClosure = {
- [weak self] in
- CommunityFollowUserViewModel.shared.follow(communityFollowDataModel: communityFollowDataModel, communityFollowDataModels: (self?.communityFollowDataModels)!, tableView: (self?.tableView)!)
- }
- cell.likeClosure = {
- [weak self] y in
- VirusViewModel.shared.like(communityFollowDataModel: communityFollowDataModel, y: y, tableView: (self?.tableView)!)
- }
- return cell
- //图片视频
- case 1:
- let cell = CardContentPicVideoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.type = .follow
- cell.communityFollowDataModel = communityFollowDataModel
- return cell
- //内容标题
- case 2:
- let cell = CardContentTitleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.communityFollowDataModel = communityFollowDataModel
- return cell
- //点赞,收藏,分享
- case 3:
- let cell = CardContentActionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.communityFollowDataModel = communityFollowDataModel
- cell.praiseClosureName = { [weak self] (button:UIButton) in
- VirusViewModel.shared.praise(communityFollowDataModel: communityFollowDataModel, tableView: (self?.tableView)!)
- }
- cell.collectClosureName = {
- [weak self] (button:UIButton) in
- VirusViewModel.shared.collection(communityFollowDataModel: communityFollowDataModel, tableView: (self?.tableView)!)
- }
- return cell
- //评论列表
- case 4:
- let cell = CardContentCommentListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.communityFollowDataModel = communityFollowDataModel
- cell.communityType = .follow
- cell.frame = tableView.bounds
- cell.layoutIfNeeded()
- cell.reloadData()
- return cell
- //评论
- case 5:
- let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
- cell.addCommnetClosureName = {
- [weak self] in
- self?.communityFollowDataModel = communityFollowDataModel
- self?.showKeyBoardCommentView()
- self?.hiddenKeyBoardCommentView()
- }
- return cell
- default:
- return UITableViewCell()
- }
- }
-
-
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- if communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- }else if communityFollowDataModels.isEmpty && !cmsMemberModels.isEmpty { //推荐关注
- }else if !communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty { //关注列表
- let communityFollowDataModel = communityFollowDataModels[indexPath.section]
- if CommunityFollowType(rawValue:communityFollowDataModel.type ?? "1") == .post { //帖子
- switch indexPath.row {
- //贴子用户
- case 0:
- break
- //图片视频/内容标题/评论列表
- case 1,2,4:
- if PostType(rawValue: communityFollowDataModel.relateData?.type ?? "video") == .video {
- NotificationCenter.default.post(name: NSNotification.Name("CommunityContentVideoClosure"), object: communityFollowDataModel.relateData?.id)
-
- }else {
- NotificationCenter.default.post(name: NSNotification.Name("CommunityContentDetailClosure"), object: communityFollowDataModel.relateData?.id)
- }
- break
- //点赞,收藏,分享
- case 3:
- break
- //评论
- case 5:
- break
- default:
- break
- }
- }else { //关注
- }
- }else {
- if indexPath.section == 0 { //推荐关注
-
- }else {//关注列表
- let communityFollowDataModel = communityFollowDataModels[indexPath.section - 1]
- if CommunityFollowType(rawValue: communityFollowDataModel.type ?? "1") == .post { //帖子
- switch indexPath.row {
- //贴子用户
- case 0:
- break
- //图片视频/内容标题/评论列表
- case 1,2,4:
- if PostType(rawValue: communityFollowDataModel.relateData?.type ?? "video") == .video {
- NotificationCenter.default.post(name: NSNotification.Name("CommunityContentVideoClosure"), object: communityFollowDataModel.relateData?.id)
-
- }else {
- NotificationCenter.default.post(name: NSNotification.Name("CommunityContentDetailClosure"), object: communityFollowDataModel.relateData?.id)
- }
- break
- //点赞,收藏,分享
- case 3:
- break
- //评论
- case 5:
- break
- default:
- break
- }
-
- }else {//关注
- }
- }
- }
- }
-
-
- /// 状态的高度
- func followStatusHeight(communityFollowDataModel:CommunityFollowDataModel) -> CGFloat {
- let communityFollowType = CommunityFollowType(rawValue: communityFollowDataModel.type ?? "1")
- switch communityFollowType {
- case .follow?:
- return 160
- case .comment?:
- return 193
- case .forward?:
- return 182
- case .like?:
- return 182
- case .collection?:
- return 182
- default:
- return 0
- }
- }
-
- /// 帖子的高度
- func postCellHeight(indexPath:IndexPath,communityFollowDataModel:CommunityFollowDataModel) -> CGFloat {
- switch indexPath.row {
- //贴子用户
- case 0:
- if communityFollowDataModel.relateData?.uid != nil {
- return 80
- }
- return 0
- //图片视频
- case 1:
-
- let cardContentPicVideoModel = CardContentPicVideoModel()
- cardContentPicVideoModel.postType = PostType(rawValue: communityFollowDataModel.relateData?.type ?? "image")!
-
- let imgStr = communityFollowDataModel.relateData?.img
- if communityFollowDataModel.relateData?.imgs?.isEmpty ?? true {
- if imgStr != "" && imgStr != nil {
- cardContentPicVideoModel.number = 1
- cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
- cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
- return cardContentPicVideoModel.collectionViewHeight() + 20
- }else {
- return 0
- }
- }else {
- if communityFollowDataModel.relateData?.imgs?.count ?? 0 == 1 {
- if imgStr != "" || imgStr != nil {
- cardContentPicVideoModel.number = 1
- cardContentPicVideoModel.width = getImageWidth(imgStr: (imgStr)!)
- cardContentPicVideoModel.height = getImageHeight(imgStr: (imgStr)!)
- return cardContentPicVideoModel.collectionViewHeight() + 20
- }else {
- return 0
- }
- }else {
- cardContentPicVideoModel.number = communityFollowDataModel.relateData?.imgs?.count ?? 0
- return cardContentPicVideoModel.collectionViewHeight() + 20
- }
- }
- //内容标题
- case 2:
- return UITableView.automaticDimension
- //点赞,收藏,分享
- case 3:
- return 54
- //评论列表
- case 4:
- if !(communityFollowDataModel.relateData?.postComment?.isEmpty ?? true) {
- return UITableView.automaticDimension
- }
- return 0
- //评论
- case 5:
- return 74
- default:
- return 0
- }
- }
-
- func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-
- if communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- return 0
- }else if communityFollowDataModels.isEmpty && !cmsMemberModels.isEmpty {
- return 191
- }else if !communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
- let communityFollowDataModel = communityFollowDataModels[indexPath.section]
- if CommunityFollowType(rawValue:communityFollowDataModel.type ?? "1") == .post {
- return postCellHeight(indexPath: indexPath, communityFollowDataModel: communityFollowDataModel)
- }else {
- return followStatusHeight(communityFollowDataModel: communityFollowDataModel)
- }
-
- }else if !communityFollowDataModels.isEmpty && !cmsMemberModels.isEmpty {
- if indexPath.section == 0 {
- return 191
- }else {
- let communityFollowDataModel = communityFollowDataModels[indexPath.section - 1]
- if CommunityFollowType(rawValue: communityFollowDataModel.type ?? "1") == .post {
- return postCellHeight(indexPath: indexPath, communityFollowDataModel: communityFollowDataModel)
-
- }else {
- return followStatusHeight(communityFollowDataModel: communityFollowDataModel)
- }
- }
- }else {
- return 0
- }
- }
-
- func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
- switch section {
- case 0:
- if !cmsMemberModels.isEmpty {
- return 62
- }
- return 0
- default:
- return 0
- }
- }
-
- func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
- switch section {
- case 0:
- if !cmsMemberModels.isEmpty {
- return 20
- }
- return 10
- default:
- return 10
- }
- }
-
- func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
- switch section {
- case 0:
- if !cmsMemberModels.isEmpty {
- let headerView = CommunityCommonSectionHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 62))
- headerView.communityCommonSectionHeaderViewType = .recommendFollow
- return headerView
- }
- return nil
- default:
- return nil
- }
- }
-
- func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
- cellHeightsDictionary.updateValue(cell.frame.size.height, forKey: indexPath)
- }
-
- func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
- let height = cellHeightsDictionary[indexPath]
- if let height = height {
- return height as! CGFloat
- }
- return UITableView.automaticDimension
- }
- func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
- return nil
- }
- }
- extension CommunityFollowViewController : JXSegmentedListContainerViewListDelegate {
- func listView() -> UIView {
- return view
- }
- }
|