From 09449c42c2d13390c2896d754e625f2544ac66b3 Mon Sep 17 00:00:00 2001 From: iAugus Date: Mon, 28 Mar 2016 22:28:16 +0800 Subject: [PATCH] Fixed time error of counter --- CountdownLabel/CountdownLabel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CountdownLabel/CountdownLabel.swift b/CountdownLabel/CountdownLabel.swift index 4633348..18e2720 100644 --- a/CountdownLabel/CountdownLabel.swift +++ b/CountdownLabel/CountdownLabel.swift @@ -193,6 +193,11 @@ public class CountdownLabel: LTMorphingLabel { // MARK: - Public public extension CountdownLabel { func start(completion: ( () -> () )? = nil) { + if !isPaused { + // current date should be setted at the time of the counter's starting, or the time will be wrong (just a few seconds) after the first time of pausing. + currentDate = NSDate() + } + // pause status check updatePauseStatusIfNeeded()