ExtensionUIScrollView.swift 379 B

123456789101112131415161718
  1. import Foundation
  2. import UIKit
  3. extension UIScrollView {
  4. var currentPage:Int{
  5. return Int((self.contentOffset.x+(0.5*self.frame.size.width))/self.frame.width)+1
  6. }
  7. func isBottom() -> Bool {
  8. if (self.bounds.size.height + self.bounds.origin.y) + 50 > self.contentSize.height{
  9. return true
  10. }
  11. return false
  12. }
  13. }