What is the difference between a path and a shape in Core Graphics?

Ios Development Questions



60 Short 45 Medium 47 Long Answer Questions Question Index

What is the difference between a path and a shape in Core Graphics?

In Core Graphics, a path is a series of connected line segments and curves that define a shape or a figure. It is a mathematical representation of the outline of a shape. Paths can be open or closed, and they can be used to draw lines, curves, and complex shapes.

On the other hand, a shape in Core Graphics refers to a filled area defined by a path. It is the result of filling the interior of a path with a color or a pattern. Shapes can be simple, such as rectangles or circles, or they can be more complex, like polygons or irregular shapes.

In summary, the main difference between a path and a shape in Core Graphics is that a path represents the outline of a shape, while a shape refers to the filled area defined by that path.