diff --git a/TIUIElements/Sources/Alerts/Helpers/View+Helpers.swift b/TIUIElements/Sources/Alerts/Helpers/View+Helpers.swift index b7184e68..2327e244 100644 --- a/TIUIElements/Sources/Alerts/Helpers/View+Helpers.swift +++ b/TIUIElements/Sources/Alerts/Helpers/View+Helpers.swift @@ -40,10 +40,11 @@ public extension View { func alert(isPresented: Binding, on context: PresentationContext, - alertViewFactory: ResultClosure) -> some View { + alertDescriptor descriptor: AlertDescriptor, + alertViewFactory: Closure) -> some View { if isPresented.wrappedValue { - alertViewFactory().present(on: context) { + alertViewFactory(descriptor).present(on: context) { isPresented.wrappedValue = false } } diff --git a/TIUIElements/Sources/Alerts/Models/AlertAction.swift b/TIUIElements/Sources/Alerts/Models/AlertAction.swift index ce2a92a0..229d3f0a 100644 --- a/TIUIElements/Sources/Alerts/Models/AlertAction.swift +++ b/TIUIElements/Sources/Alerts/Models/AlertAction.swift @@ -24,7 +24,7 @@ import TISwiftUtils import UIKit // struct describe alert button information -public struct AlertAction: Identifiable { +public struct AlertAction { public let id = UUID() @@ -52,6 +52,11 @@ extension AlertAction: Equatable { } } +// MARK: - AlertAction + Identifiable + +@available(iOS 13, *) +extension AlertAction: Identifiable { } + // MARK: - AlertAction + Helpers extension AlertAction {