Files
Martin Púčik bff35fda61 Added Swiftlint and Swiftformat plugins (#1729)
* build: Swiftlint plugin

* build: Swiftformat plugin

* build: Swiftformat plugin

* build: Swiftformat bash command

* style: Swiftformat rules

* style: Swiftformat applied to codebase

* style: Ignore Tests for Swiftlint

* Update bundler

* Update changelog and migration guide

* style: Ignore Example for Swiftlint

* chore: Changelog

* Update Xcode version for ci_pr_tests.yml

* Update ci_pr_framework.yml

* Update ci_pr_example.yml

* chore: Changelog

Co-authored-by: Jakub Kaspar <kaspikk@gmail.com>
2022-07-25 08:46:14 +00:00

28 lines
714 B
Swift

//
// AlertService.swift
// ChatExample
//
// Created by Mohannad on 12/25/20.
// Copyright © 2020 MessageKit. All rights reserved.
//
import Foundation
import UIKit
class AlertService {
static func showAlert(
style: UIAlertController.Style,
title: String?,
message: String?,
actions: [UIAlertAction] = [UIAlertAction(title: "Ok", style: .cancel, handler: nil)],
completion: (() -> Swift.Void)? = nil)
{
let alert = UIAlertController(title: title, message: message, preferredStyle: style)
for action in actions {
alert.addAction(action)
}
UIApplication.shared.delegate?.window??.rootViewController?.present(alert, animated: true, completion: completion)
}
}