//
//  AdvisoryViewController+initTableView.swift
//  MobilePortal
//
//  Created by xiejiangbo on 2019/3/14.
//  Copyright © 2019 yin chen. All rights reserved.
//

import UIKit

extension AdvisoryViewController {
    func addInitTableView() {
        if #available(iOS 11.0, *) {
            self.myTableView.contentInsetAdjustmentBehavior = .never
            self.myTableView.scrollIndicatorInsets = self.myTableView.contentInset
        }
        self.myTableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0)
        self.delegate = AdvisoryViewControllerDelegate()
        self.delegate.dataSource = self.dataSource
        registerCell(self.myTableView, cell: AdvisoryTableViewCell.self)
        self.myTableView.delegate = self.delegate
        self.myTableView.dataSource = self.delegate
        self.myTableView.backgroundColor = grayBgColor
        setExtraCellLineHidden(tableView: self.myTableView)
    }
}
class AdvisoryViewControllerDelegate: BaseOneTableViewDelegate {
    var cellNum:Double!
    override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
        return 0
    }
    
    override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        
        if (section == 0){
            return 0
        }
        return 0
    }
    
    override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        let infoMode:AdvisoryTableViewCellModel = self.dataSource[indexPath.row] as! AdvisoryTableViewCellModel
        return infoMode.h
    }
}
