Skip to content

Add defaults for easier button instantiation#118

Merged
mdmathias merged 4 commits intomainfrom
mdmathias/swiftui-button-defaults
May 3, 2022
Merged

Add defaults for easier button instantiation#118
mdmathias merged 4 commits intomainfrom
mdmathias/swiftui-button-defaults

Conversation

@mdmathias
Copy link
Copy Markdown
Collaborator

Adds default values to the initializers for GoogleSignInButtonViewModel and GoogleSignInButton to facilitate easier instantiation.

@mdmathias mdmathias added this to the 6.2.0 milestone Apr 13, 2022
@mdmathias mdmathias requested review from Alex-4-Git and petea April 13, 2022 23:28
@petea
Copy link
Copy Markdown
Contributor

petea commented Apr 28, 2022

For setting style and scheme properties, should we consider using a pattern similar to that of the Button view with its buttonStyle instance method?

@mdmathias
Copy link
Copy Markdown
Collaborator Author

mdmathias commented Apr 29, 2022

@petea can you elaborate on your question regarding buttonStyle? We are currently utilizing a custom ButtonStyle defined here.

This is set on the button here.

Copy link
Copy Markdown
Contributor

@petea petea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much easier to configure now.

Separately, at some point, we might want to think about adding a button configurator view to the Swift sample similar to the Objc sample. This would help with exploration and testing.

Comment thread GoogleSignInSwift/Sources/GoogleSignInButton.swift Outdated
Comment thread GoogleSignInSwift/Sources/GoogleSignInButtonViewModel.swift Outdated
mdmathias added 3 commits May 3, 2022 13:23
Marking the vm public will allow users of the convenience init providing params for scheme, style, and state to modify the button's appearance after initialization.
@mdmathias mdmathias force-pushed the mdmathias/swiftui-button-defaults branch from ed034d2 to c508ec2 Compare May 3, 2022 20:25
@mdmathias
Copy link
Copy Markdown
Collaborator Author

Added a new issue to track the addition of some way to update the button's appearance in the sample app.

@mdmathias mdmathias merged commit a1f1a3e into main May 3, 2022
@w-goog w-goog deleted the mdmathias/swiftui-button-defaults branch March 5, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants