mirror of
https://github.com/luxfi/safe-ios.git
synced 2026-10-30 15:19:20 +00:00
Handles #2464 * Added extension to UIAlertController.Style * Converted most of the .actionSheet to .multiplatformActionSheet to use 'alert' style on macOS and iPad
25 lines
665 B
Swift
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
|
|
}
|
|
}
|