AdaptiveAppleSignInButton 0.2.0

AdaptiveAppleSignInButton 0.2.0

André Schmidt维护。




  • 作者
  • André Schmidt

AdaptiveAppleSignInButton

更好的ASAuthorizationAppleIDButton,支持深色模式。

问题

ASAuthorizationAppleIDButton在切换亮暗模式时不更新其外观。此外,无法手动更新外观。您将不得不创建一个新的ASAuthorizationAppleIDButton实例,并使用正确的样式对其进行初始化。

解决方案

AdaptiveAppleSignInButton使用正确的样式包装了一个ASAuthorizationAppleIDButton。当userInterfaceStyle发生变化时,新的实例会替换之前的实例。

预览

要运行示例项目,请克隆仓库,然后在示例目录中首先运行pod install

深色 亮色 -
Iphone in dark mode Iphone in light mode <<<<<<<<<<<<<<<<<<<<<<<<<<

使用说明

像使用任何其他 UIButton 一样使用 AdaptiveAppleSignInButton

let appleSignInButton = AdaptiveAppleSignInButton(authorizationButtonType: .signIn, lightStyle: .black, darkStyle: .white)

安装

AdaptiveAppleSignInButton 通过 CocoaPods 提供。要安装它,只需在 Podfile 中添加以下行

pod 'AdaptiveAppleSignInButton'

许可证

AdaptiveAppleSignInButton 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。