I am trying to show an (AlertController) Action sheet. But I am getting this waning in console " <_UIPopoverBackgroundVisualEffectView 0x7fd65ef76ec0> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1. "
here is my code :-
extension GroupDataView {
func callDot (sender : UIButton)
{
let alert = UIAlertController(title: nil, message: nil,
preferredStyle: .actionSheet)
alert.addAction(UIAlertAction(title: "Edit Group", style: .default , handler:{ (action)in
print("User click Edit Group")
}))
alert.addAction(UIAlertAction(title: "Create Folder", style: .default , handler:{ (action)in
print("User click Create Folder button")
}))
alert.addAction(UIAlertAction(title: "Delete Group", style: .destructive , handler:{ (action)in
print("User click Delete Group button")
}))
if let popoverController = alert.popoverPresentationController {
popoverController.sourceView = sender
popoverController.sourceRect = sender.bounds
self.present(alert, animated: true, completion: {
print("completion block")
})
}
else
{
self.present(alert, animated: true, completion: {
print("completion block")
})
}
}
}
I don't know why this warning is showing in console. ActionSheet is coming properly but how to remove that warning? Thanks
See answer by @Hardy on Apple Developer Forum: Warning message from UIPopover †
... seems to be a bug in iOS. But it does not seem to be critical. Though - I believe - that sometimes the area below the UIAlertController is not correctly drawn. I can see for a short period of time a black background flashing although the background of the underlying view is not black.
† Cached on Google here
I had the same problem, and I resolved it by setting animated: false
in self.present
or/and self.dismiss
function. See the last comment in https://forums.developer.apple.com/thread/53677
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With