QuickReplyButtonStyleContainer
public struct QuickReplyButtonStyleContainer : ButtonStyle
Type-erased container to be used when setting own QuickReply button style
If you wish to create your own QuickReply button style, do so by conforming to ButtonStyle
, put it into QuickReplyButtonStyleContainer
and use Theme.Key
enum quickReplyButtonStyle()
to apply it.
## Example: define style
public struct MyCustomQuickReplyButtonStyle: ButtonStyle {
public func makeBody(configuration: MyCustomQuickReplyButtonStyle.Configuration) -> AnyView {
return AnyView(
configuration.label
.font(.body)
.lineLimit(1)
.padding(EdgeInsets(top: 10, leading: 16, bottom: 10, trailing: 16))
)
}
}
Example: apply style
Theme(name: "myCustomTheme", values: [
.quickReplyButtonStyle: QuickReplyButtonStyleContainer(MyCustomQuickReplyButtonStyle())
])
-
Declaration
Swift
public func makeBody(configuration: Configuration) -> some View