//
//  UIViewController+Alert.swift
//  1Weather
//
//  Created by Dmitry Stepanets on 03.12.2020.
//

import UIKit

extension UIViewController {
    func showAlert(withTitle title:String?, message:String?) {
        guard message != nil, message?.isEmpty == false else { return }
        
        DispatchQueue.main.async {
            let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
            alert.addAction(UIAlertAction(title: "Cancel", style: .cancel))
            self.present(alert, animated: true)
        }
    }
}
