TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Oct 2017 |
SwiftSwift Version | 3.0 3.0 3.0 |
SPMSupports SPM | ✗ |
Maintained by abspr.
Depends on: | |
Alamofire | >= 0 |
SwiftyJSON | >= 0 |
Abring makes it easy to implement login to your app.
Go to Abring.ir website and add an app in your panel.
You must set project name in ABAppConfig later in your project.
Type these to the Appdelegate.swift
file:
import Abring
ABAppConfig.name = "your App Id"
The login viewcontroller is highly customizable:
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.
and finally add this line of code in your viewcontroller to present login
presentLogin(style: .lightBlurBackground, delegate: self)
Don't forget to implement AbLoginDelegate
methods:
func userDismissScreen()
func userDidLogin(_ player: ABPlayer)
You can ignore our UI and implement your own UI.
Just use these methods when you need them:
ABPlayer.requestRegisterCode(phoneNumber: String, completion: LoginCompletionBlock) {}
ABPlayer.verifyRegisterCode(phoneNumber: String, code: String, completion: @escaping (_ success: Bool, _ player: ABPlayer?, _ errorType: ABErrorType?)
Abring
is available under the MIT license. See the LICENSE file for more info.