Since it's not possible to set different radius for different corners of a CALayer I had to use a masking layer instead.
Assignment of CALayer.mask cannot be animated so I had to animate path of CSShapeLayer that serves as a mask layer. CAShapeLayer.path isn't implicitly animatable and workaround for that is copying bounds.size animation and attaching that to the masking layer.