From the course: Biometric Authentication for iOS in Swift

Xcode project preparation

From the course: Biometric Authentication for iOS in Swift

Start my 1-month free trial

Xcode project preparation

- [Instructor] Now, we're going to get started with our iOS app project. So, the first thing I want to do is open up Xcode. Once Xcode's started, I want to create a new project that's going to house our app. So, I'll click on Create new Xcode project. And I'm just going to use the Single View App. And I'm going to name it BioAuth. You don't want to use a name that's actually already used in another framework, or the system could get confused. Now, I'll have my Organization Identifier as com.example, and click Next. I'm going to store it in the ExerciseFiles on my Desktop, and Create the project. Now, there's a couple of things we need to setup first. One thing is is we want to add the LocalAuthentication framework to our project. So, I'm going to scroll down to the bottom here, and click the plus under the Linked Frameworks and Libraries. And then I'll filter for local, and there's our LocalAuthentication framework, and I'll Add that. And we'll see we have it there, and under our Frameworks, and it should be in our Build Phases. So, we're fine there. The next thing I want to do is set the message for when the user's prompted for the authorization to use biometric authentication, specifically for Face ID, you don't need this for Touch ID. This is just the message that's going to be displayed when it asks the user if it's okay if this app uses it. This is not the message for when they're actually going to use biometric authentication. So, under the Info tab, I'm going to add a new item here in my PLIST. So, I'll click the plus, and I'm going to filter on Privacy. I need a capital P for it to match. And then, I can go down to Face ID Usage Description. Again, this is just used when they're asked for authorization to use this feature, not when they're authenticating. And I'm going to type in a message such as, we need to authenticate, and then just dot, dot, dot, whatever you need to present to the user based on why your app needs the ability to authenticate using Face ID. Now, if they're going to use Touch ID, this is a nonissue. But since we don't know what they're going to be using at runtime, we want to make sure we have this message in here. Now, our app is setup at least for the foundation of being capable of using biometric authentication. So, we've got that out of the way, we're ready to roll.

Contents