I have a view controller(PopOverViewController) being instantiated by another view controller(ListViewController).
Within ListViewController, PopOverViewController is modally presented:
popOverVC = self.storyboard?.instantiateViewController(withIdentifier: "sbPopUpID") as! PopUpViewController
popOverVC.modalPresentationStyle = .fullScreen
Within PopOverViewController, the PopOverViewController is animated in/out with CGAfflineTransformation:
func showAnimate()
{
self.shadowView.transform = CGAffineTransform(scaleX: 0.7, y: 0.7)
self.view.alpha = 0.0;
UIView.animate(withDuration: 0.3, animations: {
self.view.alpha = 1.0
self.shadowView.transform = CGAffineTransform(scaleX: 0.7, y: 0.7)
});
}
func removeAnimate()
{
UIView.animate(withDuration: 0.3, animations: {
self.shadowView.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
self.view.alpha = 0.0;
}, completion:{(finished: Bool) in
if (finished)
{
self.view.removeFromSuperview()
}
});
}
In the viewDidLoad of the PopOverViewController, the background color is turned down:
self.view.backgroundColor = UIColor(white: 0, alpha: 0.7)
My Question: When the PopOver is presented, the background is still visible due to the alpha of the PopOver. I would like to blur this background when the PopOver is being presented, and have the blur disappear when the PopOver is closed.
I am stumped on how to do this.
Thank you!
Swift 3