Dismissing animation of the "Sign in with apple" modal view is broken on iOS 15.1

When closing the "Sign in with apple" modal view on a real device on iOS15.1, the modal view jumps to the center of the screen then animate to the bottom and disappears. But the dismissal animation is correct on the simulator. I tested other apps with "Sign in with apple", they have the same issue. How can I fix the animation?

import SwiftUI
import AuthenticationServices

struct ContentView: View {
    var body: some View {
      VStack {
        SignInWithAppleButton(.signIn,
                              onRequest: signInWithAppleOnRequest,
                              onCompletion: signInWithAppleOnComplete
        )
      }
      .ignoresSafeArea(.all)

    }
  
  // MARK: Sign in with Apple on request

  func signInWithAppleOnRequest(request: ASAuthorizationAppleIDRequest) {
    request.requestedScopes = [.fullName, .email]
  }
  
  // MARK: Sign in with Apple on complete

  func signInWithAppleOnComplete(result: Result<ASAuthorization, Error>) {
  }
  
}

Replies

Thank goodness. Was just about to report this.. I see this too..

Ahhh I just reported this issue and finally found this.

Also seeing this - looks like a bug with Apple

Issue is still present on iOS 15.3. I've submitted a Feedback report to Apple.

Also having this issue.

Just spent a couple of hours tonight trying to debug this in a React Native app thinking it was something I did with my stack navigation. sigh Then I found this thread, and sure enough, tested on some other apps and they all have the same issue on 15.3.1. Kind of embarrassing, considering they want us to push Apple Sign In so hard.

Just ridiculous. If you make your own "Sign In with Apple" button as a UIViewRepresentable then it works fine. It's not too difficult either.

Did anyone found a solution?

@dmrozmajzl said:

If you make your own "Sign In with Apple" button as a UIViewRepresentable then it works fine.

For the record, this proposed workaround does NOT fix the issue for me (not sure if I’m misunderstanding):

class SignInWithAppleButtonView: UIViewRepresentable {
    func makeUIView(context: Context) -> ASAuthorizationAppleIDButton {
        return ASAuthorizationAppleIDButton()
    }

    func updateUIView(_ uiView: ASAuthorizationAppleIDButton, context: Context) {
    }
}

Also had this issue on ≈15.1-15.3 devices, but after update on 15.4.1 that problem with animation of Apple Sign-in dialog has gone... looks like a bug with iOS.