У меня есть нумерация страниц, и когда я пытаюсь вызвать InsertSections в PerformBatchUpdates, в первый раз все работает нормально, но при загрузке второй страницы UITableview не обновляется (нет ошибок, просто не обновляется и не вызывайте блок завершения).
Код: Выделить всё
private var periods = [PeriodHistoryModel]()
func fetchHistoryWith(models: [PeriodHistoryModel]) {
guard models.count > 0 else {
return
}
let newSectionsCount = models.count - periods.count
let lastPeriod = periods.count - 1 >= 0 ? periods.count - 1 : 0
var newRows: [IndexPath] = [IndexPath]()
var newSections: [IndexSet] = [IndexSet]()
let lastPeriodOldCount = periods.last?.sessions.count ?? 0
let lastPeriodNewCount = models[lastPeriod].sessions.count
let newSessionsCount = lastPeriodNewCount - lastPeriodOldCount
if lastPeriod >= 0 {>
for index in 0..
Подробнее здесь: [url]https://stackoverflow.com/questions/54058233/insert-section-to-uitableview[/url]
Мобильная версия