One Logo Pool Ball
_AuthenticationServices_SwiftUI · IOS API REFERENCE

SignInWithAppleButton

struct · iOS 14.0+ · SDK 27.1

@MainActor @preconcurrency struct SignInWithAppleButton

A control you add to your interface that enables users to initiate the Sign In with Apple flow. ## Initialization A SignInWithApple instance is initialized with a `SignInWithAppleButton.Label`, an onRequest closure for configuring an authorization request, and a onCompletion closure for handling the results of the authorization request. SignInWithAppleButton( .signIn, onRequest: { request in request.requestedScopes = [.fullName, .email] }, onCompletion: { result in switch result { case .success(let authResults) print("Auth Success!") case .failure(let error) print("Auth Failed: " + printError) } } )

Members (1)

init · iOS 14.0+

init

TypeScript
static init(label: SignInWithAppleButton_Label, onRequest: ((arg0: _AuthenticationServices_ASAuthorizationAppleIDRequest) => void), onCompletion: ((arg0: SDKHandle) => void)): Promise<SignInWithAppleButton>
Swift declaration
nonisolated init(_ label: SignInWithAppleButton.Label = .signIn, onRequest: @escaping (ASAuthorizationAppleIDRequest) -> Void, onCompletion: @escaping (Result<ASAuthorization, any Error>) -> Void)

Creates an instance that displays a control to Sign in with Apple. - Parameters: - label: The label set on the control (see `ButtonType`). Defaults to .signIn. - onRequest: Closure for configuring the authorization request. - onCompletion: Handler for a completed authorization request.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

SignInWithAppleButton.body

This protocol needs associated types that cannot yet cross the bridge.

All _AuthenticationServices_SwiftUI types →