mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
change presenting way
This commit is contained in:
@@ -18,11 +18,16 @@ class AlertService {
|
||||
for action in actions {
|
||||
alert.addAction(action)
|
||||
}
|
||||
if let topVC = UIApplication.getTopMostViewController() {
|
||||
alert.popoverPresentationController?.sourceView = topVC.view
|
||||
alert.popoverPresentationController?.sourceRect = CGRect(x: topVC.view.bounds.midX, y: topVC.view.bounds.midY, width: 0, height: 0)
|
||||
alert.popoverPresentationController?.permittedArrowDirections = []
|
||||
topVC.present(alert, animated: true, completion: completion)
|
||||
// if let topVC = UIApplication.getTopMostViewController() {
|
||||
// alert.popoverPresentationController?.sourceView = topVC.view
|
||||
// alert.popoverPresentationController?.sourceRect = CGRect(x: topVC.view.bounds.midX, y: topVC.view.bounds.midY, width: 0, height: 0)
|
||||
// alert.popoverPresentationController?.permittedArrowDirections = []
|
||||
// topVC.present(alert, animated: true, completion: completion)
|
||||
// }
|
||||
|
||||
if let current = (UIApplication.shared.delegate as? AppDelegate)?.window?.rootViewController {
|
||||
|
||||
current.present(alert, animated: true, completion: completion)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "camera.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "camera.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
|
||||
@@ -72,7 +72,13 @@ extension CameraInputBarAccessoryViewDelegate {
|
||||
return InputBarButtonItem()
|
||||
.configure {
|
||||
$0.spacing = .fixed(10)
|
||||
$0.image = UIImage(named: named)?.withRenderingMode(.alwaysTemplate)
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
$0.image = UIImage(systemName: "camera.fill")?.withRenderingMode(.alwaysTemplate)
|
||||
} else {
|
||||
$0.image = UIImage(named: named)
|
||||
}
|
||||
|
||||
$0.setSize(CGSize(width: 30, height: 30), animated: false)
|
||||
}.onSelected {
|
||||
$0.tintColor = .systemBlue
|
||||
|
||||
Reference in New Issue
Block a user