Class

WKInterfaceAuthorizationAppleIDButton

A button that you can use to trigger a Sign In with Apple request.

Declaration

@interface WKInterfaceAuthorizationAppleIDButton : WKInterfaceObject

Overview

Use the authorization button to initiate Sign In with Apple on Apple Watch. You can’t use this button to do anything other than initiating sign-in requests.

Don’t subclass or create instances of this class yourself. Instead, drag the button from the Object library and add it to your storyboard. Then define an outlet in your interface controller class and connect it to the button object.

@property (weak, nonatomic) IBOutlet WKInterfaceAuthorizationAppleIDButton* authorizationButton;

While initializing the interface controller, WatchKit creates a new instance of this class and assigns it to your outlet. At that point, you can use the object in your outlet to make changes to the button (for example, hiding or disabling the button). This class inherits the methods and properties from its superclass, the WKInterfaceObject class.

To respond to authorization button taps, connect the interface object in the storyboard to an action method in the interface controller:

- (IBAction)beginAppleIDSignIn

In the action method, create a sign-in request using the authorization provider, and then use an instance of ASAuthorizationController to execute the request.

Topics

Initializing for SwiftUI

- initWithTarget:action:

Creates an authorization button for use in SwiftUI.

Deprecated

Relationships

Inherits From

See Also

Controls

WKInterfaceLabel

An interface element that displays static text.

WKInterfaceDate

A label that displays the current date or time.

WKInterfaceTimer

A label that displays a countdown or count-up timer.

WKInterfaceButton

A button in the user interface of your watchOS app.

WKInterfacePaymentButton

A button that you can use to trigger payments through Apple Pay.

WKInterfaceTextField

An interface element that displays an editable text area.

WKInterfaceSwitch

An interface element that toggles between an On and Off state.

WKInterfaceSlider

An interface element that lets users select a single floating-point value from a range of values.

WKInterfaceActivityRing

A view that displays data from a HealthKit activity summary object.

WKInterfaceMap

An interface element that displays a noninteractive map for the location you specify.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software