测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017年10月 |
SwiftSwift 版本 | 3.0 3.0 3.0 |
SPM支持 SPM | ✗ |
由 abspr 维护。
依赖库 | |
Alamofire | >= 0 |
SwiftyJSON | >= 0 |
Abring 让您轻松将登录功能集成到您的应用中。
访问 Abring(ir) 网站,并在您的面板中添加一个应用。
您必须在使用 ABAppConfig 后在您的项目中设置项目名称。
将这些内容输入到 Appdelegate.swift
文件中
import Abring
ABAppConfig.name = "your App Id"
登录视图控制器具有高度可定制性
ABAppConfig.font = UIFont.systemFont(ofSize: 14) //or your own font
ABAppConfig.tintColor = UIColor.cyan
ABAppConfig.labelsColor = UIColor.gray
ABAppConfig.mainButton = UIButton() // your custom UIButton
ABAppConfig.texts.inputPhoneText = "input phone title"
ABAppConfig.texts.inputCodeText = "input code title"
ABAppConfig.buttonsTitles.loginSendCodeToPhoneButtonTitle = "Send Code"
ABAppConfig.buttonsTitles.loginConfirmCodeButtonTitle = "Done"
// you can customize textfields and their placeholders too.
并在您的视图控制器中添加此行代码以展示登录界面
presentLogin(style: .lightBlurBackground, delegate: self)
不要忘记实现 AbLoginDelegate
方法
func userDismissScreen()
func userDidLogin(_ player: ABPlayer)
您可以忽略我们的 UI 并实现自己的 UI。
当需要时,请使用以下方法
ABPlayer.requestRegisterCode(phoneNumber: String, completion: LoginCompletionBlock) {}
ABPlayer.verifyRegisterCode(phoneNumber: String, code: String, completion: @escaping (_ success: Bool, _ player: ABPlayer?, _ errorType: ABErrorType?)
Abring
在 MIT 许可下可用。有关更多信息,请查看 LICENSE 文件。