Skip to content

Commit a1d6e4f

Browse files
author
Stefano Mondino
committed
background compatibility with Swift < 4.2
1 parent 910ba06 commit a1d6e4f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Sources/Action/UIKitExtensions/UIAlertAction+Action.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ import UIKit
33
import RxSwift
44
import RxCocoa
55

6-
public extension UIAlertAction {
6+
#if swift(>=4.2)
7+
public typealias ActionStyle = UIAlertAction.Style
8+
#else
9+
public typealias ActionStyle = UIAlertActionStyle
10+
#endif
711

8-
public static func Action(_ title: String?, style: UIAlertAction.Style) -> UIAlertAction {
12+
public extension UIAlertAction {
13+
14+
public static func Action(_ title: String?, style: ActionStyle) -> UIAlertAction {
915
return UIAlertAction(title: title, style: style, handler: { action in
1016
action.rx.action?.execute(())
1117
return

0 commit comments

Comments
 (0)