Closed denisenkoaj closed 7 years ago
Hi @denisenkoaj
This is pretty simple: 1) Update your model/viewModel (rows or sections) 2) Perform updates on a table view
For example
tableDirector.replaceSection(at: 1, with: newSection)
tableView.beginUpdates()
tableView.reloadSections([1], with: .automatic)
tableView.endUpdates()
Check TableDirector.swift
file // MARK: - Sections manipulation
or TableSection.swift
file // MARK: - Public -
Thank you! Everything is work 👍
Max hello! Could you say, how i can implement reloading section with animation? Usually i do it like this:
let range = NSMakeRange(0, (self?.tableView.numberOfSections)!) let sections = NSIndexSet(indexesIn: range) self?.tableView.reloadSections(sections as IndexSet, with: .automatic)
I tried a lot of different ways to do it with tablekit, but i have runtime errors that either sections or rows are not correctly calculated by the table itself before and after the update.