Closed tethridge closed 7 years ago
I couldn't find anything about how to best do this either and so I've got something like this now:
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
let scrollViewHeight = scrollView.frame.size.height
let scrollContentSizeHeight = scrollView.contentSize.height
let scrollOffset = scrollView.contentOffset.y
if scrollOffset + scrollViewHeight >= scrollContentSizeHeight {
fetchOlderMessages()
}
super.scrollViewDidScroll(scrollView)
}
slk_isAtTop
didn't work for me as it always seemed to return true
no matter what.
I found a library that seems to work alright. It doesn't show the UIActivityIndicator row when the scrollview is reversed (as it is by default). It shows as you're dragging, but not if you let go of the screen.
I haven't spent the time to figure out why the inset isn't working. It may be due to the insets that the Slack VC sets that is overriding the intended functionality.
https://github.com/icodesign/ICSPullToRefresh.Swift
Thanks for the help though!
I haven't been able to find any information about how the SlackTextViewController handles a large history of messages. Is there any documentation or a sample that describes how to page in history as the user scrolls back in time?