当单元格展开时,它会崩溃应用程序
func tableView(_ tableView: SLExpandableTableView!, willExpandSection 部分: UInt, 动画: Bool) {
}
func tableView(_ tableView: SLExpandableTableView!, didExpandSection section: UInt, animated: Bool)
{
let indexPath = IndexPath(row: 0, section: Int(section))
let cell: SLExpandableHeaderCell = (tableView.cellForRow(at: indexPath) as! SLExpandableHeaderCell)
cell.empProfImage?.image = UIImage(named: "upArrowGrey.png")
// let imgCategorySymbol: UIImageView = (cell.viewWithTag(5030) as! UIImageView)
// imgCategorySymbol.image = UIImage(named: "upArrowGrey.png")
for i in 0..<arrCategoriesServices.count
{
if !selectedSectionIndex.contains("\(i)") && i != Int(section) {
tableView.collapseSection(i, animated: true)
}
}
}
func tableView(_ tableView: SLExpandableTableView!, willCollapseSection section: UInt, animated: Bool) {
let indexPath = IndexPath(row: 0, section: Int(section))
let cell: SLExpandableHeaderCell = (tblExpandableView.cellForRow(at: indexPath) as! SLExpandableHeaderCell)
cell.empProfImage?.image = UIImage(named: "downArrowGrey.png")
// let imgCategorysymbol: UIImageView? = (cell.viewWithTag(5030) as! UIImageView)
// imgCategorysymbol?.image = UIImage(named: "downArrowGrey.png")
}
func tableView(_ tableView: SLExpandableTableView, canChangeSection section: Int) -> Bool {
if collapsingSection != section {
return true
}
else {
return false
}
}
func tableView(_ tableView: SLExpandableTableView!, didCollapseSection section: UInt, animated: Bool) {
}
func tableView(_ tableView: SLExpandableTableView, canExpandSection section: Int) -> Bool
{
return true
}
func tableView(_ tableView: SLExpandableTableView!, needsToDownloadDataForExpandableSection section: Int) -> Bool
{
return false
}
func tableView(_ tableView: SLExpandableTableView!, expandingCellForSection section: Int) -> UITableViewCell
{
var cell: SLExpandableHeaderCell!
if cell == nil
{
cell = tblExpandableView.dequeueReusableCell(withIdentifier: headerCell) as! SLExpandableHeaderCell
}
let label = UILabel()
label.frame = CGRect(x: CGFloat(10), y: CGFloat(10), width: CGFloat(100), height: CGFloat(25))
cell.addSubview(label)
cell.empProfImage?.image = UIImage(named: "downArrowGrey.png")
cell?.selectionStyle = .none
let cat: CategoryModel = (arrCategory[section] as! CategoryModel)
label.text = cat.categoryName
print("Expanding table for categoty : \(cat.categoryName)")
// cell.textLabel?.frame = frame
// cell?.textLabel?.text = cat.categoryName
// Util.setCategoryDetailFontColorAndSize(label: (cell?.textLabel!)!, labelText: cat.categoryName) Util.setCategoryDetailFontColorAndSize(label: label, labelText: cat.categoryName) cell?.textLabel?.backgroundColor = UIColor.clear
return cell!
}
public func tableView(_ tableView: SLExpandableTableView!, downloadDataForExpandableSection section: Int)
{
}