-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SwiftUI Support for Button #1960
Closed
Closed
Conversation
This file contains 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
09b2a97
to
4b72ae8
Compare
2 tasks
I am not able to test how the UIKit button responds to keyboard interactions in iPad. I tried but couldn't get control to reach this delegate method and see how it behaves. So I've not implemented the focus ring view in the new |
11 tasks
Most properties are setup based on control token set. Only padding, shadow and font left.
Add CustomizableButton protocol to calculate padding and height. This can be shared with the UIKit button as well instead of having static methods on button token set.
4231893
to
fc2364c
Compare
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Platforms Impacted
Description of changes
Added a new
FluentButtonStyle
which confirms toSwiftUI.ButtonStyle
. This makes it easy to apply fluent styles to any button in SwiftUI.The behaviour of styles in SwiftUI is slightly different from how we work with custom components in UIKit. Hence, this new
FluentButtonStyle
does not affect the content inside the button, which can be text, image or both. We can create a separate custom SwiftUI view to mimic the behaviour of the custom UIKit button with regards to images and text.Binary change
Total increase: 1,50,920 bytes
Total decrease: -920 bytes
Full breakdown
Verification
Compared existing buttons in UIKit with SwiftUI. Looks similar.
Visual Verification
Pull request checklist
This PR has considered:
Microsoft Reviewers: Open in CodeFlow