     }
 
     open func endRefreshing() {
-        state = .idle
+        if Date().timeIntervalSince(lastUpdated) < 0.1 {
+            DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
+                self.state = .idle
+            }
+        }
     }
 }

    fileprivate var loadingText = localizedString(key: "Loading")
    fileprivate var isAutomaticallyRefresh = true
    fileprivate var triggerAutomaticallyRefreshPercent: CGFloat = 0.1

    var state: RefreshState? {
        didSet {

    }

    fileprivate func beginRefreshing() {
        if Date().timeIntervalSince(lastUpdated) < 1 {
            return
        }
        lastUpdated = Date()

        UIView.animate(withDuration: kCustomRefreshFastAnimationTime, animations: {
            self.alpha = 1.0
        })
