Drop-in auth
The AWSMobileClient
client supports a "drop-in" UI component that allows you to easily add the full capabilities for authentication to your application.
AWSMobileClient.default().showSignIn( navigationController: self.navigationController!, { (signInState, error) in if let signInState = signInState { print("Sign in flow completed: \(signInState)") } else if let error = error { print("error logging in: \(error.localizedDescription)") } })
Note: The drop-in UI requires the use of a navigation controller. Please make sure your app has an active navigation controller which is passed in via the
navigationController
parameter.
Customization
You can change the following properties of the drop-in UI with the AWSMobileClient
:
- Logo: Any image file of png or jpg
- Background Color: Any iOS UIColor
AWSMobileClient.default() .showSignIn( navigationController: self.navigationController!, signInUIOptions: SignInUIOptions( // dismiss the sign-in process canCancel: false, logoImage: UIImage( named: "MyCustomLogo" ), backgroundColor: UIColor.black ) ) { (result, err) in //handle results and errors }