@@ -20,20 +20,26 @@ extension UIAlertController {
20
20
value: " Add Time " ,
21
21
comment: " "
22
22
)
23
- let alert = UIAlertController ( title: localizedString, message: nil , preferredStyle: . actionSheet)
23
+ let actionSheet = UIAlertController (
24
+ title: localizedString,
25
+ message: nil ,
26
+ preferredStyle: UIDevice . current. userInterfaceIdiom == . pad ? . alert : . actionSheet
27
+ )
28
+ actionSheet. overrideUserInterfaceStyle = . dark
29
+ actionSheet. view. tintColor = . AlertController. tintColor
24
30
products. sortedByPrice ( ) . forEach { product in
25
31
guard let localizedTitle = product. customLocalizedTitle else {
26
32
return
27
33
}
28
34
let action = UIAlertAction ( title: localizedTitle, style: . default, handler: { _ in
29
- alert . dismiss ( animated: true , completion: {
35
+ actionSheet . dismiss ( animated: true , completion: {
30
36
didRequestPurchase ( product)
31
37
} )
32
38
} )
33
39
action
34
40
. accessibilityIdentifier =
35
41
" \( AccessibilityIdentifier . purchaseButton. asString) _ \( product. productIdentifier) "
36
- alert . addAction ( action)
42
+ actionSheet . addAction ( action)
37
43
}
38
44
let cancelAction = UIAlertAction ( title: NSLocalizedString (
39
45
" PRODUCT_LIST_CANCEL_BUTTON " ,
@@ -42,7 +48,7 @@ extension UIAlertController {
42
48
comment: " "
43
49
) , style: . cancel)
44
50
cancelAction. accessibilityIdentifier = AccessibilityIdentifier . cancelPurchaseListButton. asString
45
- alert . addAction ( cancelAction)
46
- return alert
51
+ actionSheet . addAction ( cancelAction)
52
+ return actionSheet
47
53
}
48
54
}
0 commit comments