How to round shadow corners from curl animation of UIView?

I am trying to animate UIView using UIView.transition with [.transitionCurlUp] as argument option. However, the corners are still shown as invisible elements that the shadow falls on:

https://ibb.co/q9B34Sy

https://ibb.co/hfLk8vQ

https://ibb.co/7VzgVyj


 @IBOutlet weak var buttonToBeCurled: UIView! {
    didSet {
        let tap = UITapGestureRecognizer(target: self, action: #selector(curlTappedView))
        buttonToBeCurled.addGestureRecognizer(tap)
        buttonToBeCurled.layer.cornerRadius = 35
        buttonToBeCurled.backgroundColor = UIColor.purple
    }
 }
 @objc func curlTappedView(_ gesture: UITapGestureRecognizer) {
    
    let tappedView = gesture.view!
    
    UIView.transition(with: tappedView, duration: 3.0, options: [.transitionCurlUp], animations: {
    })
  } 
}

Is there something about the way animation works while curling the uiview?

You are not the only one to search: https://stackoverflow.com/questions/72502618/how-to-set-background-color-animation

I've tried to set buttonToBeCurled.layer.shadowOpacity to 0.0 or buttonToBeCurled.layer.shadowColor to UIColor.clear.cgColor to no avail. 

How to round shadow corners from curl animation of UIView?
 
 
Q