1

Seems like this has been asked before but I tried all the solutions but they don't seem to work. I tried both the solutions :

if scrollView.isPagingEnabled {
    if scrollView.scrollToBottom() == true {
        scrollView.isPagingEnabled = false
    }
} else {
    if scrollView.scrollToBottom() == false {
        scrollView.isPagingEnabled = true
    }
} 

And

scrollView.isPagingEnabled = self.scroll_course_detail.contentOffset.y < (self.scroll_course_detail.contentSize.height - self.scroll_course_detail.frame.size.height)

Here are the values which I get in the logs :

print("self.contentSize.height : \(self.contentSize.height)")
print("self.frame.size.height : \(self.frame.size.height)")
print("self.contentOffset.y : \(self.contentOffset.y)")  

self.contentSize.height : 597.405
self.frame.size.height : 520.0
self.contentOffset.y : 75.0

The difference between self.contentSize.height and self.frame.size.height comes out to be 77.405 (not 75). And I cannot do a static check by adding that extra 2.405 since that would not handle other cases.
I cannot disable paging for scrollView since I am using it.

Nitish
  • 13,845
  • 28
  • 135
  • 263
  • Please try to rephrase your question, as what you currently have doesn't make any sense. Where are you executing `scrollView.isPagingEnabled = ...`? What does `scrollView.scrollToBottom()` do that it returns a boolean value? When are you printing height and contentOffset values? What are you actually trying to do? – DonMag May 06 '19 at 12:13

0 Answers0