 }
 
 extension UIViewController{
-
+    
     func showMessage(_ title: String, message:String, completion: (()->Void)? = nil){
         let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
         alert.addAction(UIAlertAction(title: "OK".localized, style: .default, handler: { (action: UIAlertAction!) in

        }))
        self.present(alert, animated: true, completion: nil)
    }

    func showDeleteAlert(_ title: String?, message:String?, completion: (()->Void)? = nil){
        let deleteAlert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
        deleteAlert.addAction(UIAlertAction(title: "Delete".localized, style: .destructive, handler: { (action: UIAlertAction!) in

    }
    
    func showAlert(message:String){
        delayOnMainQueue {
            let alert = UIAlertController(title: "Alert".localized, message: message, preferredStyle: UIAlertControllerStyle.alert)
            alert.addAction(UIAlertAction(title: "OK".localized, style: UIAlertActionStyle.default, handler: nil))
            self.present(alert, animated: true, completion: nil)
        }    }
    
    func showError(message:String){
        delayOnMainQueue {
            let alert = UIAlertController(title: "Error".localized, message: message, preferredStyle: UIAlertControllerStyle.alert)
            alert.addAction(UIAlertAction(title: "OK".localized, style: UIAlertActionStyle.cancel))
            self.present(alert, animated: true, completion: nil)
        }    }
    
    func showError(error:Error){
        delayOnMainQueue {
            let alert = UIAlertController(title: "Error".localized, message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
            alert.addAction(UIAlertAction(title: "OK".localized, style: UIAlertActionStyle.cancel))
            self.present(alert, animated: true, completion: nil)
        }
    }
    
    func showConnectionError(message:String){
        delayOnMainQueue {
            let messageConnection = "Please check your internet connection to continue".localized
            let alert = UIAlertController(title: "You are offline".localized, message: messageConnection, preferredStyle: UIAlertControllerStyle.alert)
            alert.addAction(UIAlertAction(title: "OK".localized, style: UIAlertActionStyle.cancel))
            self.present(alert, animated: true, completion: nil)
        }    }
    
}

