본문 바로가기
Programming/Swift

[Readable Coding Practice] eliminate empty UItableView cells

by Eisen Sophie 2021. 6. 28.
extension UITableView {
    func removeExcessCells() {
        tableFooterView = UIView(frame: .zero)
    }
}

By applying this code, you can make your tableview look like following pictures. 

(Left): Empty cells are shown                                                               (Right): Empty cells are not shown