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.
1AWSMobileClient.default().showSignIn(2 navigationController: self.navigationController!, { (signInState, error) in3 if let signInState = signInState {4 print("Sign in flow completed: \(signInState)")5 } else if let error = error {6 print("error logging in: \(error.localizedDescription)")7 }8 }9)
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
1AWSMobileClient.default()2 .showSignIn(3 navigationController: self.navigationController!,4 signInUIOptions: SignInUIOptions(5 // dismiss the sign-in process6 canCancel: false,7 logoImage: UIImage(8 named: "MyCustomLogo"9 ),10 backgroundColor: UIColor.black11 )12 ) { (result, err) in13 //handle results and errors14 }