iOS Swift Customizing Lock

Sample Project

Download this sample project configured with your Auth0 API Keys.

System Requirements
  • CocoaPods 1.1.1
  • Version 8.2 (8C38)
  • iPhone 6 - iOS 10.2 (14C89)
Show requirements

Before Starting

You need the Lock library integrated in your project. Make sure you've followed the login tutorial and you know how to present the login dialog.

User Experience

The Lock experience can be extensively customized through a combination of Lock methods.

Configure the Style

Lock's UI is composed of several parts that can be customized.

Lock UI

You can find the full list of style properties in the style struct documentation

So, for example, if you want to achieve something like this:

Lock Custom UI

You can make use of the withStyle method when initializing Lock:

    .withStyle {
        $0.title = "Phantom Inc."
        $0.headerBlur = .extraLight
        $0.logo = LazyImage(name: "icn_phantom")
        $0.primaryColor = UIColor ( red: 0.6784, green: 0.5412, blue: 0.7333, alpha: 1.0 )
    .present(from: self)

You can find more examples in the Styling Lock section of the Lock README.

Configuring the Options

You can find more detailed information in the Configuration options section of the Lock README.

Previous Tutorial
7. Linking Accounts
Use Auth0 for FREECreate free Account