         return colors
     }
 
-    private func restoreTitleColors(_ colors: [ControlTitleColor]?) {
+    fileprivate func restore(titleColors colors: [ControlTitleColor]?) {
         guard let colors = colors else { return }
         for color in colors {
             setTitleColor(color.1, for: color.0)
         }
     }
 
-    private func removeAllTitleColors() {
-        restoreTitleColors(allTitleColors().map({ return ($0.0, UIColor.clear) }))
-    }
-}
+    fileprivate func removeAllTitleColors() {
+        restore(titleColors: allTitleColors().map({ return ($0.0, UIColor.clear) }))
+    }
+}

     
     - Parameter enablesUserInteraction: A boolean that specifies if the user interaction on the view should be enabled when the spinner is dismissed
     */
    func dismiss(enablesUserInteraction enablesUserInteraction: Bool)
}

public extension Spinner {
    func dismiss(enablesUserInteraction enablesUserInteraction: Bool = false){}
}

public class SpinnerView: NSObject, Spinner {

    //TODO: Add an option to offset the indicator in the view or button

    private var controlTitleColors: [ControlTitleColor]?
    private var spinner: UIActivityIndicatorView?
    private var imageView: UIImageView?

    /**
     To display the indicator centered in a view.

        if let button = spinner?.superview as? UIButton {

            button.isUserInteractionEnabled = true
            button.restore(titleColors: controlTitleColors)
            if enablesUserInteraction {
                button.isUserInteractionEnabled = true
            }
        }
        if let view = spinner?.superview, enablesUserInteraction == true {
            view.isUserInteractionEnabled = true
        }
        
        spinner?.dismiss()
