You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Components could be decomposed to separate public parts for better reusability and flexibility. We would still keep the convenience standalone component, but it would be a thin wrapper over its FooButtonStyle + FooContent implementation.
Add internal environmentKey for buttonPressed(Bool) to be able to snapshot and preview active button states.
For example, ListChoice would be restructured into:
Content component ListChoiceContent that defines the layout itself (plus accessibility)
A ButtonStyleListChoiceButtonStyle that takes care of proper isPressed and similar interaction (keeping title as a Button Label to provide label accessibility automatically)
Components could be decomposed to separate public parts for better reusability and flexibility. We would still keep the convenience standalone component, but it would be a thin wrapper over its
FooButtonStyle
+FooContent
implementation.Add internal environmentKey for
buttonPressed(Bool)
to be able to snapshot and preview active button states.For example,
ListChoice
would be restructured into:ListChoice(…)
, as-isListChoiceContent
that defines the layout itself (plus accessibility)ButtonStyle
ListChoiceButtonStyle
that takes care of properisPressed
and similar interaction (keeping title as a Button Label to provide label accessibility automatically)This way, such components could be structured as:
Limitation
In SwiftUI, a ButtonStyle definition cannot be specified using other (more generic, for example)
.buttonStyle()
The text was updated successfully, but these errors were encountered: