in CustomUI/CustomUI/Controllers/MainViewController.swift [142:155]
func presentActionSheet(title: String, actions: [UIAlertAction], sourceView: UIView) {
DispatchQueue.main.async { [weak self] in
let actionSheet = UIAlertController(title: title, message: nil, preferredStyle: .actionSheet)
let close = UIAlertAction(title: "Close", style: .cancel, handler: { (action) in
actionSheet.dismiss(animated: true)
})
close.setValue(self?.isDarkMode ?? false ? DarkThemeColors.actionSheetItem : LightThemeColors.actionSheetItem, forKey: "titleTextColor")
actionSheet.addAction(close)
actions.forEach { actionSheet.addAction($0) }
actionSheet.popoverPresentationController?.sourceView = sourceView
actionSheet.popoverPresentationController?.sourceRect = sourceView.bounds
self?.present(actionSheet, animated: true)
}
}