 
     public func start() {
         let alert = type.alertController(preferredStyle: preferredStyle)
+        if case .actionSheet(let source) = preferredStyle, let sourceView = source {
+            switch sourceView {
+            case .button(let button):
+                alert.popoverPresentationController?.barButtonItem = button
+            case .view(let view):
+                alert.popoverPresentationController?.sourceView = view
+            }
+        }
         parentViewController.present(alert, animated: animated, completion: nil)
         viewController = alert
     }

import UIKit

public class AlertCoordinator: DefaultCoordinator {
    enum InputType {
        case error(Error)
        case custom(title: String?, message: String?, actions: [ErrorAction]?)

        func alertController(preferredStyle: UIAlertControllerStyle = .alert) -> UIAlertController {
            switch self {
            case .error(let error):
                return UIAlertController(error: error, preferredStyle: preferredStyle)
            case .custom(let title, let message, let actions):
                let alert = UIAlertController(title: title, message: message, preferredStyle: preferredStyle)
                (actions ?? [ErrorAction(title: NSLocalizedString("OK", comment: "OK"))]).map { $0.alertAction() }.forEach(alert.addAction)
                return alert
            }

        alertCoordinator.start()
    }

    public func showAlert(title: String?, message: String?, actions: [ErrorAction]? = nil, preferredStyle: AlertCoordinator.Style = .alert) {
        guard let viewController = self.viewController else {
            return
        }
