 
 class ViewController: UIViewController {
     
+    private let countDownMinutes: Double = 0.5
     private let activeOffset: CGFloat = 5
     private let inactiveOffset: CGFloat = 25
     

    
    fileprivate func updateTimer() {
        
        guard let timerElapsesOnDate = timerElapsesOnDate else { return }
        
        let interval = DateInterval(start: Date(), end: timerElapsesOnDate)
        
        let minutes = Int(interval.duration) / 60 % 60
        let seconds = Int(interval.duration) % 60
        
        labelTimer.text = String(format:"%02i:%02i", minutes, seconds)
    }
}


        currentState = currentState == .idle ? .active : .idle
        
        if currentState == .active {
            timerElapsesOnDate = Date().addingTimeInterval(countDownMinutes * 60)
            timer.start(0.25, callDelegateWhenExpired: self)
        }
        
