I'm trying to do custom transitioning for modal view presentation using UIPresentationController
, like below.
I scaled my presenting view like the following (inside func presentingTransitionWillBegin()
):
self.presentingViewController.view.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
However, background of the presentingView
is always black, and I can't find the right place to change the color.
I tried adding a white-colored view to the containerView
and then add self.presentingViewController.view
as its subview:
someView.backgroundColor = UIColor.white
containerView.addSubview(someView)
someview.addSubview(self.presentingViewController.view)
well, it worked somehow. but obviously it crashes after I dismiss the modal view. and I can't find where to place back this self.presentingViewController.view
when dismiss transition ends!
Ultimately, I want to achieve something like below: