diff --git a/Example/ExpyTableView/CustomizationExampleViewController.swift b/Example/ExpyTableView/CustomizationExampleViewController.swift index 7463e6c..02fd78f 100644 --- a/Example/ExpyTableView/CustomizationExampleViewController.swift +++ b/Example/ExpyTableView/CustomizationExampleViewController.swift @@ -12,6 +12,24 @@ import ExpyTableView class CustomizationExampleViewController: UIViewController { let sampleData = [["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], + ["iPhone 6 (3 Items)", "128 GB Memory", "4.7 inches", "Apple A8, 64 bit"], + ["iPhone 7 Plus (4 Items)", "256 GB Memory", "5.5 inches", "Apple A10 Fusion(64 bit)", "Force Touch: Yes"], + ["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], + ["iPhone 6 (3 Items)", "128 GB Memory", "4.7 inches", "Apple A8, 64 bit"], + ["iPhone 7 Plus (4 Items)", "256 GB Memory", "5.5 inches", "Apple A10 Fusion(64 bit)", "Force Touch: Yes"], + ["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], + ["iPhone 6 (3 Items)", "128 GB Memory", "4.7 inches", "Apple A8, 64 bit"], + ["iPhone 7 Plus (4 Items)", "256 GB Memory", "5.5 inches", "Apple A10 Fusion(64 bit)", "Force Touch: Yes"], + ["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], + ["iPhone 6 (3 Items)", "128 GB Memory", "4.7 inches", "Apple A8, 64 bit"], + ["iPhone 7 Plus (4 Items)", "256 GB Memory", "5.5 inches", "Apple A10 Fusion(64 bit)", "Force Touch: Yes"], + ["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], + ["iPhone 6 (3 Items)", "128 GB Memory", "4.7 inches", "Apple A8, 64 bit"], + ["iPhone 7 Plus (4 Items)", "256 GB Memory", "5.5 inches", "Apple A10 Fusion(64 bit)", "Force Touch: Yes"], + ["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], + ["iPhone 6 (3 Items)", "128 GB Memory", "4.7 inches", "Apple A8, 64 bit"], + ["iPhone 7 Plus (4 Items)", "256 GB Memory", "5.5 inches", "Apple A10 Fusion(64 bit)", "Force Touch: Yes"], + ["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], ["iPhone 6 (3 Items)", "128 GB Memory", "4.7 inches", "Apple A8, 64 bit"], ["iPhone 7 Plus (4 Items)", "256 GB Memory", "5.5 inches", "Apple A10 Fusion(64 bit)", "Force Touch: Yes"], ["iPhone SE (3 Items)", "64 GB Memory", "4 inches", "Apple A9, 64 bit"], diff --git a/ExpyTableView/Classes/ExpyTableView.swift b/ExpyTableView/Classes/ExpyTableView.swift index b71e9e5..f1388cd 100644 --- a/ExpyTableView/Classes/ExpyTableView.swift +++ b/ExpyTableView/Classes/ExpyTableView.swift @@ -224,12 +224,14 @@ extension ExpyTableView: UITableViewDataSource { return headerCell } - if visibleSections[indexPath.section] == true { - headerCellConformant.changeState(.willExpand, cellReuseStatus: true) - headerCellConformant.changeState(.didExpand, cellReuseStatus: true) - }else { - headerCellConformant.changeState(.willCollapse, cellReuseStatus: true) - headerCellConformant.changeState(.didCollapse, cellReuseStatus: true) + DispatchQueue.main.async { [weak self] _ in + if self?.visibleSections[indexPath.section] == true { + headerCellConformant.changeState(.willExpand, cellReuseStatus: true) + headerCellConformant.changeState(.didExpand, cellReuseStatus: true) + }else { + headerCellConformant.changeState(.willCollapse, cellReuseStatus: true) + headerCellConformant.changeState(.didCollapse, cellReuseStatus: true) + } } return headerCell }