GoogleSignInButton
@available(iOS 13.0, macOS 10.15, *)
public struct GoogleSignInButton : View
A Google Sign In button to be used in SwiftUI.
-
An object containing the styling information needed to create the button.
Declaration
Swift
@ObservedObject public var viewModel: GoogleSignInButtonViewModel { get set }
-
Creates an instance of the Google Sign-In button for use in SwiftUI
Seealso
Refer toGoogleSignInButtonViewModel.swift
for its defaults.Declaration
Swift
public init( viewModel: GoogleSignInButtonViewModel = GoogleSignInButtonViewModel(), action: @escaping () -> Void )
Parameters
viewModel
An instance of
GoogleSignInButtonViewModel
containing information on the button’s scheme, style, and state. Defaults toGoogleSignInButtonViewModel
with its standard defaults.action
A closure to use as the button’s action upon press.
-
A convenience initializer to create a Google Sign-In button in SwiftUI with scheme, style, and state.
Declaration
Swift
public init( scheme: GoogleSignInButtonColorScheme = .light, style: GoogleSignInButtonStyle = .standard, state: GoogleSignInButtonState = .normal, action: @escaping () -> Void )
Parameters
scheme
The
GoogleSignInButtonColorScheme
to use. Defaults to.light
.style
The
GoogleSignInButtonStyle
to use. Defaults to.standard
.state
The
GoogleSignInButtonState
to use. Defaults to.normal
.action
A closure to use as the button’s action upon press.
-
Declaration
Swift
public var body: some View { get }