Adding custom functions for iOS scroll detection