A simple to use class for displaying an account-creation controller.
This was created in Swift Playgrounds as a "self-test"-- a way for me to get used to working with constraints in code. Kuddos to Brian Voong for giving me the inspriation to try it out, and a basis for some of this code. It is in no way a project without it's share of bugs, so you may need to adapt it to fit your use case.
If you'd like to just play around with the project without integrating it into an application, download the entire playground.
Otherwise, download the AccountController.swift file inside the playground. Once downloaded, insert it into your Xcode project and configure + present it like so:
let controller = AccountController()
controller.setup(backgroundColor: UIColor(r: 61, g: 107, b: 179), buttonColor: UIColor(r: 94, g: 118, b: 188), buttonTextColor: nil, logo: UIImage(named: "facebook"))
present(controller, animated: true, completion: nil)
You may need to tweak the constraints in order to get the logo to display properly. This is a known bug and will be fixed soon.
Integration Code:
func presentAccountController() {
let controller = AccountController()
controller.setup(backgroundColor: UIColor(r: 61, g: 107, b: 179), buttonColor: UIColor(r: 94, g: 118, b: 188), buttonTextColor: nil, logo: UIImage(named: "facebook"))
present(controller, animated: true, completion: nil)
}
It's that easy.
- Some logos require modifications to get them to work as intended
This project is avaliable under the MIT License.