Created
July 13, 2020 09:53
-
-
Save Heilum/abb558e6ef25dd54599dbb243f749ece to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIRefreshControl { | |
func beginRefreshingManually(_ tintColor:UIColor) { | |
self.tintColor = tintColor | |
if let scrollView = superview as? UIScrollView { | |
scrollView.setContentOffset(CGPoint(x: 0, y:scrollView.contentOffset.y - frame.height), animated: false) | |
} | |
beginRefreshing() | |
self.sendActions(for: .valueChanged) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment