I'm try to dynamically create puzzle piece, and it looks like this:
I want to fill this shape with some color so it will looks like this:
so I can use it for masking some image.
I creating this shape with 4 UIBezierPath, then convert it to 1 path using
After some time I found a reason why I got these results.
If you want to create some path for filling you should not use
moveToPoint method, instead you should just once set first point using
moveToPoint and then draw all lines with
After you complete draw your path do not forget send
Before I knew this, I drew every side of puzzle piece using different UIBezierPath instances and for every path I set first point using