A framework to create a secure and easy login system with customizable layout.
- Swift 4.2+
- Xcode 10.0+
CaerbannogLogin is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CaerbannogLogin', :git => 'https://github.com/dbarbos/CaerbannogLogin.git'
- Import the framework CaerbannogLogin in your AppDelegate;
- Configure the way to connect to your server creating a ConnectionConfig object in didFinishLaunchingWithOptions. E.g.: the following example is to configure a Laravel Passport Client Password.
let connection:ConnectionConfig = .LaravelPassportClientPassword(requestTokenEndpoint: String, validadeTokenEndpoint: String, clientId: String, clientSecret: String)
- Initialize the framework with CaerbanoggLogin.shared.initialize with:
- Your connection object created in item 2;
- A view controller to proceed after login process is completed.
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewController = storyboard.instantiateViewController(withIdentifier: "OtherViewController")
CaerbanoggLogin.shared.initialize(whereNextViewControllerIs: initialViewController, connection: connection)
- Customize passing a layout to CaerbanoggLogin.shared.setLayout(). There is two types of layout configuration, to simplify create a Simple Layout and change there properties.
let simpleLayout = SimpleLayout()
simpleLayout.primaryColor = UIColor
simpleLayout.secondaryColor = UIColor
simpleLayout.backgroundImage = UIImage
CaerbanoggLogin.shared.setLayout(layout: .Simple(layout: simpleLayout))
- Lastly, show your login controller with the method .showController()
CaerbanoggLogin.shared.showController()
EXTRAS
6) If you want to customize all elements separately, create an AdvanceLayout and change there properties. After, assign this new object to CaerbanoggLogin.shared.setLayout() method
let advancedLayout = AdvancedLayout()
advancedLayout.button.font = UIFont.systemFont(ofSize: 32)
CaerbanoggLogin.shared.setLayout(layout: .Advanced(layout: advancedLayout))
- To logout, use the function logout assigning a UIViewController to be the next controller in flow after a new login:
CaerbanoggLogin.shared.logout(nextViewController: UIViewController())
dbarbos, dilermando.barbosa@gmail.com
leodegeus7, leonardodegeus@gmail.com
- 0.0.1
- First Commit
- 0.0.2
- Created logout method and updaded DemoApp
- 0.0.40
- Updated to Swift 4.2;
- Added protection space for CredStore;
- Fix biometry challenge to include face ID;
- 0.0.41
- Fixed problem with LAError
- Created animation for biometric identification
- 0.0.42
- Created function to return Login Controller
CaerbannogLogin is available under the MIT license. See the LICENSE file for more info.