Last active
January 5, 2023 21:15
-
-
Save michaelevensen/d29f5dec0b7c03473e61bd6bd74b2315 to your computer and use it in GitHub Desktop.
Use `@ViewBuilder` in extensions. Basically cast to `AnyView`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ButtonStyle where Self == InputFieldButtonStyle<AnyView> { | |
internal static func input<Content: View>(mimicksDropdown: Bool = false, | |
@ViewBuilder placeholderContent: @escaping () -> Content? = { nil }) -> InputFieldButtonStyle<AnyView> { | |
InputFieldButtonStyle(mimicksDropdown: mimicksDropdown, | |
placeholderContent: { | |
AnyView(placeholderContent()) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment