Is it possible to make a concave shape of the side of a view?
I managed to round the edges with border radius, but I wonder if it's possible to make other nice transformations. Here is the example:
1)This is my progress so far:
2)This is how it should be:
Is it possible to make a view look this way programmatically? If not, I guess I'll use a png image to achieve this, but it's always nicer to finish these sort of stuff through code
You can use UIBezierPath
/CGPath
to achieve this.
There is a good documentation from Apple about drawing, giving you hints ont curves, lines, etc:
Once you created your shape:
CAShapeLayer *maskLayer = [CAShapeLayer layer];
[maskLayer setFrame:[viewToMask bounds]];
[maskLayer setPath:[theBezierPath CGPath]];
[viewToMask layer] setMask = layer;