Skip to content

Commit

Permalink
fixed ambigeous issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgr-ksmt committed Jul 5, 2019
1 parent d63b986 commit 9b31fe5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Sources/ActionSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ extension Alertift {
}

/// Add action to alertController
public func action(_ action: Alertift.Action, handler: Handler? = nil) -> Self {
public func action(_ action: Alertift.Action, handler: Handler?) -> Self {
return self.action(action, image: nil, handler: handler)
}

public func action(_ action: Alertift.Action, handler: ShortHandler?) -> Self {
public func action(_ action: Alertift.Action, handler: ShortHandler? = nil) -> Self {
return self.action(action) { _, _ in handler?() }
}


/// Add action to alertController
public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, handler: Handler? = nil) -> Self {
public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, handler: Handler?) -> Self {
let alertAction = buildAlertAction(action, handler:
merge(_alertController.actionHandler, handler ?? { (_, _) in })
)
Expand Down
8 changes: 4 additions & 4 deletions Sources/Alert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extension Alertift {
buildAlertControlelr(title: title, message: message, style: .alert)
}

public func action(_ action: Alertift.Action, handler: Handler? = nil) -> Self {
public func action(_ action: Alertift.Action, handler: Handler?) -> Self {
return self.action(action, isPreferred: false, handler: handler)
}

Expand All @@ -59,7 +59,7 @@ extension Alertift {
/// - isPreferred: If you want to change this action to preferredAction, set true. Default is false.
/// - handler: The block to execute after this action performed.
/// - Returns: Myself
public func action(_ action: Alertift.Action, isPreferred: Bool, handler: Handler? = nil) -> Self {
public func action(_ action: Alertift.Action, isPreferred: Bool, handler: Handler?) -> Self {
return self.action(action, image: nil, isPreferred: isPreferred, handler: handler)
}

Expand All @@ -75,7 +75,7 @@ extension Alertift {
/// - renderMode: Render mode for alert action image. Default is `.automatic`
/// - handler: The block to execute after this action performed.
/// - Returns: Myself
public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, handler: Handler? = nil) -> Self {
public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, handler: Handler?) -> Self {
return self.action(action, image: image, renderingMode: renderingMode, isPreferred: false, handler: handler)
}

Expand All @@ -92,7 +92,7 @@ extension Alertift {
/// - isPreferred: If you want to change this action to preferredAction, set true. Default is false.
/// - handler: The block to execute after this action performed.
/// - Returns: Myself
public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, isPreferred: Bool, handler: Handler? = nil) -> Self {
public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, isPreferred: Bool, handler: Handler?) -> Self {
let alertAction = buildAlertAction(
action,
handler: merge(_alertController.actionWithTextFieldsHandler, handler ?? { (_, _, _)in })
Expand Down

0 comments on commit 9b31fe5

Please sign in to comment.