Files
safe-ios/Multisig/UI/UI Library/UIAlertControllerStyle+Multiplatform.swift
Dmitry Bespalov c7e927c254 GH-2464 fix crashing on presentation of an actionSheet on iPad
Handles #2464

* Added extension to UIAlertController.Style
* Converted most of the .actionSheet to .multiplatformActionSheet to use 'alert' style on macOS and iPad
2023-08-10 15:03:27 +02:00

25 lines
665 B
Swift

//
// UIAlertControllerStyle+Multiplatform.swift
// Multisig
//
// Created by Dmitrii Bespalov on 10.08.23.
// Copyright © 2023 Gnosis Ltd. All rights reserved.
//
import UIKit
extension UIAlertController.Style {
// Thanks to adamek and matt for the inspiration https://stackoverflow.com/questions/73007791/is-there-a-way-to-detect-which-platform-is-running-in-an-xcode-ios-macos-multipl
static var multiplatformActionSheet: UIAlertController.Style {
#if os(iOS)
if UIDevice.current.userInterfaceIdiom == .phone {
return .actionSheet
} else {
return .alert
}
#else
return .alert
#endif
}
}