1 year ago

#150252

test-img

ashipma

UIBezierPath combine shapes

This is not asking the same question as How can I combine UIBezierPath drawings? even though the name is similar


I have a shape that needs to be able to scale vertically and on one side of it are rounded corners and the other side is some other path. I have drawn the following image to show what I am talking about, but this is not the exact shape I am making, but conceptually it is the same idea.

sample image

In this image, the left side is half of a rounded rectangle and the right side is half of a circle.

So I am wanting to take and essentially cut a rounded rectangle in half and basically "merge" it with another path. How can I do this?

I guess one way would be to have two layers: the top layer contains the shape on the right and the bottom layer contains the rounded rectangle, and the top layer occludes half of the rectangle. But I was hoping to not have to use two different layers, and instead be able to put all of this in one layer, so I was wondering if it was possible to merge the shapes like I mentioned.

ios

uibezierpath

cashapelayer

0 Answers

Your Answer

Accepted video resources