             updateUI()
         }
     }
-    
-    
-    // MARK: - Internal properties
     
     public struct Config {
         public var alertTitle: String?

    }
    
    
    // MARK: - Constants
    
    fileprivate static let topOffset: CGFloat = -200.0

    
    // MARK: - Public functions
    
    public func present(from viewController: UIViewController, for duration: TimeInterval? = nil, title: String? = nil, message: String? = nil, image: UIImage? = nil, buttonImage: UIImage? = nil, buttonTitle: String = NSLocalizedString("OK", comment: "Button title to dismiss alert"), onDismiss: (() -> Void)? = nil, onRightButton: (() -> Void)? = nil) {
        timer?.invalidate()
        let config = Config(alertTitle: title, alertMessage: message, alertImage: image, buttonImage: buttonImage, buttonTitle: buttonTitle, onRightButton: onRightButton, onDismiss: onDismiss)
        if let duration = duration {
            timer = Timer.scheduledTimer(timeInterval: duration, target: self, selector: #selector(closeAlert), userInfo: nil, repeats: false)
        }
        if viewController.presentedViewController == self {
            reshowAlert(with: config)
        } else {
            self.config = config
            viewController.present(self, animated: false)
        }
    }
    
    public func dismissAlert() {
        closeAlert()
    }
    
    
