简体   繁体   English

在 Swift5 中使用苹果登录

[英]Sign In with apple in Swift5

I had implement Sign In with the apple button.我已经用苹果按钮实现了登录。 It's functionality working.它的功能工作。 But the issue is its title looks like " SIGN_IN_WITH_APPLE " instead of " Sign in with Apple ".但问题是它的标题看起来像“ SIGN_IN_WITH_APPLE ”而不是“ Sign in with Apple ”。 here is my code.这是我的代码。

let authorizationButton = ASAuthorizationAppleIDButton() 
authorizationButton.cornerRadius = 10
authorizationButton.addTarget(self, action: #selector(handleLogInWithAppleIDButtonPress), for: .touchUpInside)
cell.signInStack.addArrangedSubview(authorizationButton)

And How it's look以及它的外观在此处输入图片说明

I tried我试过

let button = ASAuthorizationAppleIDButton()
print(button.accessibilityLabel ?? "")

and it prints它打印

Sign in with Apple

I am not sure, if you can change it, but我不确定,如果你能改变它,但是

Automatic translation of the button's title into the language that's set for the device将按钮的标题自动翻译成为设备设置的语言

could explain your trouble, the only way that you can alter the button name is by changing the locale可以解释您的问题,您可以更改按钮名称的唯一方法是更改​​语言环境

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM