From e51a323cc221195dfe5ea15adf148e77308882a2 Mon Sep 17 00:00:00 2001 From: Josip Cavar Date: Sat, 26 Sep 2015 10:41:54 +0200 Subject: [PATCH] fix issue #22 multiple startAnimating calls --- Refresher/PullToRefreshView.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Refresher/PullToRefreshView.swift b/Refresher/PullToRefreshView.swift index 69e1ac4..2d98713 100644 --- a/Refresher/PullToRefreshView.swift +++ b/Refresher/PullToRefreshView.swift @@ -55,10 +55,12 @@ public class PullToRefreshView: UIView { internal var loading: Bool = false { didSet { - if loading { - startAnimating() - } else { - stopAnimating() + if loading != oldValue { + if loading { + startAnimating() + } else { + stopAnimating() + } } } }