Caps-iOS/CapCollector/Extensions/ViewControllerExtensions.swift

29 lines
685 B
Swift
Raw Normal View History

2018-08-16 11:18:27 +02:00
//
// 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)
}
}