Skip to content

Commit

Permalink
Add default to handler arguments. (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored Aug 19, 2024
1 parent 150eb9f commit 08fc8fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/UIKitNavigation/Navigation/UIAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/// - handler: A closure that is invoked with an action held in `state`.
public convenience init<Action>(
state: AlertState<Action>,
handler: @escaping (_ action: Action?) -> Void
handler: @escaping (_ action: Action?) -> Void = { (_: Never?) in }
) {
self.init(
title: String(state: state.title),
Expand All @@ -34,7 +34,7 @@
/// - handler: A closure that is invoked with an action held in `state`.
public convenience init<Action>(
state: ConfirmationDialogState<Action>,
handler: @escaping (_ action: Action?) -> Void
handler: @escaping (_ action: Action?) -> Void = { (_: Never?) in }
) {
self.init(
title: state.titleVisibility == .visible ? String(state: state.title) : nil,
Expand Down Expand Up @@ -71,7 +71,7 @@
extension UIAlertAction {
public convenience init<Action>(
_ button: ButtonState<Action>,
action handler: @escaping (_ action: Action?) -> Void
action handler: @escaping (_ action: Action?) -> Void = { (_: Never?) in }
) {
self.init(
title: String(state: button.label),
Expand Down

0 comments on commit 08fc8fd

Please sign in to comment.