Bläddra i källkod

Make the view model a public property on the button

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.
Matthew Mathias 3 år sedan
förälder
incheckning
c508ec2c48
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      GoogleSignInSwift/Sources/GoogleSignInButton.swift

+ 2 - 1
GoogleSignInSwift/Sources/GoogleSignInButton.swift

@@ -22,7 +22,8 @@ import CoreGraphics
 /// A Google Sign In button to be used in SwiftUI.
 @available(iOS 13.0, macOS 10.15, *)
 public struct GoogleSignInButton: View {
-  @ObservedObject var viewModel: GoogleSignInButtonViewModel
+  /// An object containing the styling information needed to create the button.
+  @ObservedObject public var viewModel: GoogleSignInButtonViewModel
   private let action: () -> Void
   private let fontLoaded: Bool