I m using Animation in table view cell...Animation is working fine when cell is totally visible.if any cell is partially visible at that time due to Animation my app is gett
I solved this bug by calling reloadData() for last section:
func expandSectionPressed(sender: UIButton) {
let object = items[sender.tag]
object.expanded = !object.expanded
sender.selected = object.expanded
var indexPaths = [NSIndexPath]()
for i in 0..<7 {
indexPaths.append(NSIndexPath(forRow: i, inSection: sender.tag))
}
if object.expanded {
tableView.insertRowsAtIndexPaths(indexPaths, withRowAnimation: .Fade)
} else {
// strange crash when deleting rows from the last section //
if sender.tag < numberOfSectionsInTableView(tableView) - 1 {
tableView.deleteRowsAtIndexPaths(indexPaths, withRowAnimation: .Fade)
} else {
tableView.reloadData()
}
}
}