Search code examples
iosswiftuitableviewtablefooterview

swift how to display a footer that can't be seen unless scrolled up further after reaching bottom?


I'm trying to display a "that's all" message to the user if the user reaches the bottom of the table view but keeps scrolling up, like the "you're up to date" message slack displays at the bottom of the chat. However, the tableFooterView can be seen at the very bottom of the table view and isn't hidden. How should this be done?


Solution

  • I use this solution:

    let test=UILabel(frame: CGRect(x: 0,y: tableView.contentSize.height+180, width: tableView.frame.width, height: 50))
    test.text="That's all"
    view.insertSubview(test, belowSubview: tableView)