Skip to content

Enable automatic async/await API generation #91

Closed

Description

@paulb777

The GSI completion handlers use callback as the parameter selector for specifying completion handlers.

callback is not one of the selectors included for automatic async method generation. See https://developer.apple.com/documentation/swift/calling_objective-c_apis_asynchronously

If I manually change the selector in the GIDSignIn.h public header to completion, Xcode will auto-generate the API:

Screen Shot 2022-01-14 at 2 54 16 PM

Activity

  1. peterfriese commented on Jul 16, 2022

    @peterfriese

    See Calling Objective-C APIs Asynchronously | Apple Developer Documentation for details. Specifically, if the trailing completion block uses the following names, it will automatically be made available to Swift as an async method:

    • completion
    • withCompletion
    • completionHandler
    • withCompletionHandler
    • completionBlock
    • withCompletionBlock
    • replyTowithReplyTo
    • reply
    • replyTo

    This is based on SE 0297, which discusses a number of Objective-C attributes that can be used to guide the translation process.

  2. added a commit that references this issue on Jul 17, 2022
    0cb0462
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions