Post

Thanks to #SwiftUI 's powerful graphics APIs, I am this close to retiring my copy of Photoshop CS6 for good 🤏

16 reposts156 likes

robb@robb.is

Quick tutorial how the stitching was achieved: - Use `strokedPath(_:)` to split the path into multiple lines, using a two-component dash array. - Convert to a CGPath, split it into subcomponents using `componentsSeparated(using:)`. - Apply a rotation to each line. - Merge them back together.

Thank you! (Of course my perfectionist friend called me out that the drop shadow on the stitching should really be an inner shadow but 🤫)

Quick tutorial how the stitching was achieved: - Use `strokedPath(_:)` to split the path into multiple lines, using a two-component dash array. - Convert to a CGPath, split it into subcomponents using `componentsSeparated(using:)`. - Apply a rotation to each line. - Merge them back together.

To improve the effect, I added a second darker line underneath with an inverted dash array to draw the stitch holes.

Hi Robb :) Thanks for the great idea—I had a lot of fun trying it out! I especially appreciated the tip about componentsSeparated. One question: how did you get that rounded look when clipping with an SF Symbol? Adding white/black shadows above and below? I’ll grateful if you could share idea.

I found ShadowStyle.drop/inner—I think that was it, right? I’m amazed SwiftUI can create effects like this. It’s such a great framework! I’m looking forward to your posts 🐱<3