Custom ButtonStyle not supported; `ButtonStyle` declaration incorrect
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
https://developer.apple.com/documentation/SwiftUI/ButtonStyle
https://www.avanderlee.com/swiftui/swiftui-button-styles/
ButtonStyle is a protocol, allowing you to implement its makeBody(configuration:) function to implement a custom button style.
SkipUI defines a struct called ButtonStyle with no makeBody implementation; it's basically an enum.
As a result, if you try to define a custom ButtonStyle with a makeBody implementation, Skip will spew a bunch of confusing errors ("Skip is unable to determine the owning type for member"); if you do manage to convince it it compile, it simply won't work.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Sources/SkipUI/SkipUI/Controls/Button.swift at the ButtonStyle declaration linked in the issue, then compare it with SwiftUI's ButtonStyle protocol and its makeBody(configuration:) requirement. Confirm how custom styles are handled in SkipUI and verify that a style implementing makeBody can compile and work as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100