Regular #swift and #swiftui programming will resume after the break, until then: ✨ syndication ✨
Quick SDF-based Pull to Refresh indicator, built with Metal and #SwiftUI

@dlx curious to see how different the implementation is from this canvas based concept I made a while back (for the blob part) https://twitter.com/stammy/status/1579525123123843072

https://gist.github.com/stammy/27c4844c0148109fe89f8a0694694c8c

[email protected] on Twitter

“Liquid blob effect using #SwiftUI https://t.co/1EWcHTOtet”

Twitter
@stammy I'll dig it up when I have a moment, but basically the entire thing is a function of pixel position & scroll offset to color
@stammy There's a bunch of signed distance field explanations floating around
@dlx no worries, I’m not too familiar with SDF so was curious if it’s roughly the same technical approach as using the canvas alpha threshold and blur filters
@stammy it's not soo far off but it operates on "vector" graphics so the distance function kinda does the bitmap conversion, blur and threshold in one.
@stammy @dlx do we think the actual implementation of the Dynamic Island took either of these two approaches? Could it just have been Core Graphics paths?
@cdoncarroll @stammy I don't think bezier paths lend themselves well to some of these effects. My hunch is SDFs give you the most control over the outline but I'm not sure. Also haven't seen the Dynamic Island IRL.
@dlx @cdoncarroll not sure if this is the recording itself but looks like this may have some jaggyness at the edges
@stammy @cdoncarroll I’ll check, if anything it’s my incompetence, not the technique