Neumorphic Button SwiftUI

Hello there! I'm trying to create a button with a neumorphic animation using SwiftUI, with a smooth animation when the user taps it. Something like this:

Can someone help me to figure out this, please?

Thanks!

You want to animate with a sequence of images ?

This is likely to provide a solution. Will it be smooth enough ?

https://stackoverflow.com/questions/56722695/how-to-animate-a-sequence-of-images-using-swiftui

I've seen it but it doesn't seem the answer of my question, maybe I explained my self not clearly. I want to create a button with the neumorphic animation.

Did you consider subclassing UIButton ? And create the animation in the draw() func ?

See a pattern of subclassing (unfortunately, not with the animation). That's UIKit, but you can call from SwiftUI.

https://trailingclosure.com/create-a-custom-uibutton-with-states/

Hope that helps.

Neumorphic Button SwiftUI
 
 
Q