This example shows the process from designing the shape you want to drawing it on a view. A specific shap is used but the concepts you learn can be applied to any shape.
These are the main steps:
drawRect
or using a CAShapeLayer
.You could do anything, but as an example I have chosen the shape below. It could be a popup key on a keyboard.
Look back at your shape design and break it down into simpler elements of lines (for straight lines), arcs (for circles and round corners), and curves (for anything else).
Here is what our example design would look like: