<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/SignInWithAppleButton/init(_:onRequest:onCompletion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Authentication Services",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:31_AuthenticationServices_SwiftUI21SignInWithAppleButtonV_9onRequest0J10CompletionA2C5LabelV_ySo015ASAuthorizationH9IDRequestCcys6ResultOySo0N0Cs5Error_pGctcfc"
  },
  "title" : "init(_:onRequest:onCompletion:)"
}
-->

# init(_:onRequest:onCompletion:)

Creates a Sign in with Apple button.

```
nonisolated init(_ label: SignInWithAppleButton.Label = .signIn, onRequest: @escaping (ASAuthorizationAppleIDRequest) -> Void, onCompletion: @escaping (Result<ASAuthorization, any Error>) -> Void)
```

## Parameters

`label`

The label that appears on the button.

`onRequest`

The authorization request for an Apple ID.

`onCompletion`

The completion handler that the system calls when the sign-in completes.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)