In App I have subclassed UINavigationBar and as my TitleView I'm setting(in View Controller) custom UIView
[self.playButton setBackgroundColor:[UIColor yellowColor]];
[self.navigationItem setTitleView:self.playButton];
The bottom edge of this view (playButton) should be curved. Not only corners, bot whole bottom edge.To achieve this effect I'm using this code:
CAShapeLayer *maskLayer = [CAShapeLayer layer];
UIBezierPath *path = [[UIBezierPath alloc] init];
[path addCurveToPoint:CGPointMake(self.playButton.frame.size.width, self.playButton.frame.size.height) controlPoint1:CGPointMake(0, self.playButton.frame.size.height) controlPoint2:CGPointMake(self.playButton.frame.size.width, 60)];
maskLayer.path = path.CGPath;
self.playButton.layer.mask = maskLayer;
But after that code my UIView (playButton) dissapeared! Is this proper way to apply curved bottom edge of UIView?
It should looks like this: https://i.stack.imgur.com/MLbSv.png