To make myself clear, I'm not asking how to use buttonStyle. I know that much. My question more lies in how does buttonStyle change the appearance of the button it's put on?
So let's say I'm creating a custom component. I want that custom component to accept styles. Sure I could create an init that accepts a style but that doesn't feel very SwiftUI-ey. Instead, I want to be able to create a modifier that works similarly to the buttonStyle modifier.
This is my desired outcome:
CustomComponent()
.customStyle(CustomComponentPlainStyle())
// where CustomComponentPlainStyle is any struct that conforms to CustomComponentStyle
From my digging I discovered I have to somehow make use of a makeBody function that will create the desired look for the style from a given Configuration, not sure how to put all the pieces together though. Would apreciate any sort of direction!
Cheers!