 
 /// Presenter that displays NVActivityIndicatorView as UI blocker.
 public final class NVActivityIndicatorPresenter {
-    private var showTimer: Timer?
-    private var hideTimer: Timer?
-    private var isStopAnimatingCalled = false
+    private enum State {
+        case waitingToShow
+        case showed
+        case waitingToHide
+        case hidden
+    }
+
     private let restorationIdentifier = "NVActivityIndicatorViewContainer"
     private let messageLabel: UILabel = {
         let label = UILabel()


        messageLabel.font = activityData.messageFont
        messageLabel.textColor = activityData.textColor
        setMessage(activityData.message)
        containerView.addSubview(messageLabel)

        // Add constraints for `messageLabel`.

     Remove UI blocker.
     */
    public final func stopAnimating() {
        _hide()
    }

    /// Set message displayed under activity indicator view.
    ///
    /// - Parameter message: message displayed under activity indicator view.
    public final func setMessage(_ message: String?) {
        guard state == .showed else {
            startAnimatingGroup.notify(queue: DispatchQueue.main) {
                self.messageLabel.text = message
            }

            return
        }

        messageLabel.text = message
    }

    // MARK: - Helpers
