diff --git a/Sources/UIKitNavigation/Navigation/UIAlertController.swift b/Sources/UIKitNavigation/Navigation/UIAlertController.swift index a8e75d4ed..4a1e62c3a 100644 --- a/Sources/UIKitNavigation/Navigation/UIAlertController.swift +++ b/Sources/UIKitNavigation/Navigation/UIAlertController.swift @@ -24,6 +24,9 @@ for button in state.buttons { addAction(UIAlertAction(button, action: handler)) } + if state.buttons.isEmpty { + addAction(UIAlertAction(title: "OK", style: .cancel)) + } } /// Creates and returns a view controller for displaying an action sheet using a data @@ -57,6 +60,9 @@ for button in state.buttons { addAction(UIAlertAction(button, action: handler)) } + if state.buttons.isEmpty { + addAction(UIAlertAction(title: "OK", style: .cancel)) + } } }