I have 2D array var students = [[Student]]
I need to conform this array should be keep always 3 in memory so when this array insert new itme then remove from old from top
I have to insert array this way
self.students.append(student) //Update students property
and trying with this line but
tableview
not update smoothly when I remove item using this line
self.students.removeFirst()
so what How can I remove array item from top for table view smoothly scrolling
Note array hooked table view
func numberOfSections(in tableView: UITableView) -> Int {
return self.students.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return students[section].count
}