在 Swift5 中使用苹果登录 [英] Sign In with apple in Swift5

查看:44
本文介绍了在 Swift5 中使用苹果登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用苹果按钮实现了登录.它的功能工作.但问题是它的标题看起来像SIGN_IN_WITH_APPLE"而不是使用 Apple 登录".这是我的代码.

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". here is my code.

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

以及它的外观

推荐答案

我试过了

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

然后打印

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

这篇关于在 Swift5 中使用苹果登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆