Caps-iOS/CapCollector/Extensions/ViewControllerExtensions.swift
2020-05-16 11:21:55 +02:00

29 lines
690 B
Swift

//
// ViewControllerExtensions.swift
// CapFinder
//
// Created by User on 18.03.18.
// Copyright © 2018 User. All rights reserved.
//
import Foundation
import UIKit
extension UIViewController {
// MARK: Alerts
/// Present an alert with a message to the user
func showAlert(_ message: String, title: String = "Error") {
let alertController = UIAlertController(
title: title,
message: message,
preferredStyle: .alert)//,
//blurStyle: .dark)
alertController.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
self.present(alertController, animated: true, completion: nil)
}
}