How to remove extra empty cells in TableViewController, iOS - Swift

后端 未结 13 964
暗喜
暗喜 2020-12-22 16:12

Hi I have a TableViewController with two static cells, however when displayed, it shows the two static cells, and then all the other empty cells for the tablevi

13条回答
  •  有刺的猬
    2020-12-22 16:23

    if you want to remove rows for all UITableViews in your app, just add an extension like this:

    Swift 5.0

    extension UITableView {
    
    override open func didMoveToSuperview() {
        super.didMoveToSuperview()
        self.tableFooterView = UIView()
    
    }
    

提交回复
热议问题