├── .swift-version
├── _config.yml
├── TJBioAuthentication
├── TJBioAuthentication.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── project.pbxproj
└── TJBioAuthentication
│ ├── Extensions
│ ├── keyBoardHelper.swift
│ └── alertHelper.swift
│ ├── BioAuth
│ ├── TJDefaultMessages.swift
│ ├── TJAuthErrors.swift
│ └── TJBioAuthenticator.swift
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── ViewController.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ └── AppDelegate.swift
├── TJBioAuthentication.podspec
├── LICENSE
├── .gitignore
└── README.md
/.swift-version:
--------------------------------------------------------------------------------
1 | 4.2
2 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-leap-day
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/Extensions/keyBoardHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // keyBoardHelper.swift
3 | // BioAuth
4 | //
5 | // Created by Tejas Ardeshna on 03/11/17.
6 | // Copyright © 2017 Tejas Ardeshna. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | extension UIViewController
13 | {
14 | func hideKeyboard()
15 | {
16 | let tap: UITapGestureRecognizer = UITapGestureRecognizer(
17 | target: self,
18 | action: #selector(UIViewController.dismissKeyboard))
19 |
20 | view.addGestureRecognizer(tap)
21 | }
22 |
23 | @objc func dismissKeyboard()
24 | {
25 | view.endEditing(true)
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/Extensions/alertHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // alertHelper.swift
3 | // BioAuth
4 | //
5 | // Created by Tejas Ardeshna on 03/11/17.
6 | // Copyright © 2017 Tejas Ardeshna. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 | extension UIViewController {
12 |
13 | func presentAlert(withTitle title: String, message : String) {
14 | DispatchQueue.main.async {
15 | let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
16 | let OKAction = UIAlertAction(title: "OK", style: .default) { action in
17 | print("You've pressed OK Button")
18 | }
19 | alertController.addAction(OKAction)
20 | self.present(alertController, animated: true, completion: nil)
21 |
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/TJBioAuthentication.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'TJBioAuthentication'
3 | s.version = '1.2.0'
4 | s.summary = 'Apple biometric authentication for Touch ID and Face ID.'
5 |
6 | s.description = 'Apple biometric authentication for Touch ID and Face ID. Now you can authenticate with Apple Face ID or Touch ID'
7 |
8 | s.homepage = 'https://github.com/tejas-ardeshna/TJBioAuthentication'
9 | s.license = { :type => 'MIT', :file => 'LICENSE' }
10 | s.author = { 'Tejas Ardeshna' => 'tejasardeshna@gmail.com' }
11 | s.source = { :git => 'https://github.com/tejas-ardeshna/TJBioAuthentication.git', :tag => s.version.to_s }
12 | s.social_media_url = 'https://twitter.com/tejas_ardeshna'
13 |
14 | s.ios.deployment_target = '9.0'
15 | s.source_files = 'TJBioAuthentication/TJBioAuthentication/BioAuth/**/*'
16 |
17 | end
18 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Tejas Ardeshna
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/BioAuth/TJDefaultMessages.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TJDefaultMessages.swift
3 | // BioAuth
4 | //
5 | // Created by Tejas Ardeshna on 03/11/17.
6 | // Copyright © 2017 Tejas Ardeshna.
7 | //
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | //
27 |
28 | import Foundation
29 | import UIKit
30 | enum TJDefaultMessages : String {
31 | case defaultReasonMessage = "Authentication is needed to access your app."
32 | case lockoutReasonMessage = "Too many failed attempts."
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | NSFaceIDUsageDescription
32 | $(PRODUCT_NAME) requires Face ID permission to authenticate using Face recognition.
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // TJBioAuthentication
4 | //
5 | // Created by Tejas Ardeshna on 03/11/17.
6 | // Copyright © 2017 Tejas Ardeshna. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | @IBOutlet weak var txtPassword: UITextField!
14 | @IBOutlet weak var btnPasswordLogin: UIButton!
15 | @IBOutlet weak var btnBiometricLogin: UIButton!
16 |
17 | @IBAction func btnBiometricLoginClicked(_ sender: Any) {
18 |
19 | TJBioAuthenticator.shared.authenticateUserWithBiometrics(success: {
20 | // Biometric Authentication success
21 | self.showSuccessAlert()
22 | }) { (error) in
23 | // Biometric Authentication unsuccessful
24 | switch error{
25 | case .biometryLockedout:
26 | self.executePasscodeAuthentication()
27 | default:
28 | self.presentAlert(withTitle: "Error", message: error.getMessage())
29 | break
30 | }
31 | }
32 | }
33 |
34 | override func viewDidLoad() {
35 | super.viewDidLoad()
36 | self.hideKeyboard()
37 | // Do any additional setup after loading the view, typically from a nib.
38 | }
39 |
40 | func executePasscodeAuthentication()
41 | {
42 | TJBioAuthenticator.shared.authenticateUserWithPasscode(success: {
43 | self.showSuccessAlert()
44 | }) { (error) in
45 | self.presentAlert(withTitle: "Error", message: error.getMessage())
46 | }
47 | }
48 | }
49 |
50 | extension ViewController
51 | {
52 | func showSuccessAlert() {
53 | DispatchQueue.main.async {
54 | self.presentAlert(withTitle: "Success", message: "Login successful")
55 | }
56 | }
57 | }
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Adapted from https://github.com/github/gitignore/blob/master/Swift.gitignore
2 |
3 | # Finder
4 | .DS_Store
5 |
6 | # Xcode
7 | ## Build generated
8 | build/
9 | DerivedData/
10 |
11 | ## Various settings
12 | *.pbxuser
13 | !default.pbxuser
14 | *.mode1v3
15 | !default.mode1v3
16 | *.mode2v3
17 | !default.mode2v3
18 | *.perspectivev3
19 | !default.perspectivev3
20 | xcuserdata/
21 |
22 | ## Other
23 | *.moved-aside
24 | *.xccheckout
25 | *.xcscmblueprint
26 |
27 | ## Obj-C/Swift specific
28 | *.hmap
29 | *.ipa
30 | *.dSYM.zip
31 | *.dSYM
32 |
33 | ## Playgrounds
34 | timeline.xctimeline
35 | playground.xcworkspace
36 |
37 | # Swift Package Manager
38 | #
39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40 | # Packages/
41 | # Package.pins
42 | .build/
43 |
44 | # CocoaPods
45 | #
46 | # We recommend against adding the Pods directory to your .gitignore. However
47 | # you should judge for yourself, the pros and cons are mentioned at:
48 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
49 | #
50 | # Pods/
51 |
52 | # Carthage
53 | #
54 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
55 | # Carthage/Checkouts
56 |
57 | Carthage/Build
58 |
59 | # fastlane
60 | #
61 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
62 | # screenshots whenever they are needed.
63 | # For more information about the recommended setup visit:
64 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
65 |
66 | fastlane/report.xml
67 | fastlane/Preview.html
68 | fastlane/screenshots
69 | fastlane/test_output
70 |
71 | # Code Injection
72 | #
73 | # After new code Injection tools there's a generated folder /iOSInjectionProject
74 | # https://github.com/johnno1962/injectionforxcode
75 |
76 | iOSInjectionProject/
77 |
78 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // TJBioAuthentication
4 | //
5 | // Created by Tejas Ardeshna on 03/11/17.
6 | // Copyright © 2017 Tejas Ardeshna. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/BioAuth/TJAuthErrors.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TJAuthErrors.swift
3 | // BioAuth
4 | //
5 | // Created by Tejas Ardeshna on 03/11/17.
6 | // Copyright © 2017 Tejas Ardeshna.
7 | //
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | //
27 |
28 | import Foundation
29 | import LocalAuthentication
30 |
31 | // Authentication Errors
32 | public enum TJAuthErrors {
33 |
34 | case appCancel, failed, userCancel, userFallback, systemCancel, passcodeNotSet, biometryNotEnrolled, biometryLockedout, invalidContext , biometryNotAvailable,other
35 |
36 | public static func errorType(_ error: LAError) -> TJAuthErrors {
37 | switch Int32(error.errorCode) {
38 |
39 | case kLAErrorAuthenticationFailed:
40 | return failed
41 | case kLAErrorUserCancel:
42 | return userCancel
43 | case kLAErrorUserFallback:
44 | return userFallback
45 | case kLAErrorSystemCancel:
46 | return systemCancel
47 | case kLAErrorPasscodeNotSet:
48 | return passcodeNotSet
49 | case kLAErrorBiometryNotEnrolled:
50 | return biometryNotEnrolled
51 | case kLAErrorBiometryLockout:
52 | return biometryLockedout
53 | case kLAErrorAppCancel:
54 | return appCancel
55 | case kLAErrorInvalidContext:
56 | return invalidContext
57 | case kLAErrorBiometryNotAvailable:
58 | return biometryNotAvailable
59 | default:
60 | return other
61 | }
62 | }
63 |
64 | // get error message based on type
65 | public func getMessage() -> String {
66 | switch self {
67 | case .appCancel:
68 | return "Authentication was cancelled by application."
69 | case .failed:
70 | return "The user failed to provide valid credentials."
71 | case .invalidContext:
72 | return "The context is invalid."
73 | case .userFallback:
74 | return "The user chose to use the fallback."
75 | case .userCancel:
76 | return "The user did cancel."
77 | case .passcodeNotSet:
78 | return "Passcode is not set on the device."
79 | case .systemCancel:
80 | return "Authentication was cancelled by the system."
81 | case .biometryNotEnrolled:
82 | return "Biometric is not enrolled on the device."
83 | case .biometryLockedout:
84 | return "Too many failed attempts."
85 | case .biometryNotAvailable:
86 | return "Biometric is not available on the device."
87 | case .other:
88 | return "Did not find error code on LAError object."
89 | }
90 | }
91 | }
92 |
93 |
94 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TJBioAuthentication
2 | > Apple bio metric authentication for touchID and faceID
3 |
4 | [![Swift Version][swift-image]][swift-url]
5 | [![Build Status][travis-image]][travis-url]
6 | [![License][license-image]][license-url]
7 | [](https://img.shields.io/cocoapods/v/LFAlertController.svg)
8 | [](http://cocoapods.org/pods/LFAlertController)
9 | [](http://makeapullrequest.com)
10 |
11 |
12 |
13 |
14 | ## Features
15 |
16 | - [x] FaceID authentication
17 | - [x] TouchID authentication
18 | - [x] Passcode authentication
19 | - [x] Batter error handeling
20 |
21 |
22 | ## Requirements
23 |
24 | - iOS 10.0+
25 | - Xcode 9.0
26 |
27 | ## Installation
28 |
29 | #### CocoaPods
30 |
31 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
32 |
33 | ```bash
34 | $ gem install cocoapods
35 | ```
36 |
37 |
38 |
39 | To integrate TJBioAuthentication into your Xcode project using CocoaPods, specify it in your `Podfile`:
40 |
41 | ```ruby
42 | source 'https://github.com/CocoaPods/Specs.git'
43 | platform :ios, '10.0'
44 | use_frameworks!
45 |
46 | target '' do
47 | pod 'TJBioAuthentication'
48 | end
49 | ```
50 |
51 | Then, run the following command:
52 |
53 | ```bash
54 | $ pod install
55 | ```
56 |
57 | #### Manually
58 | 1. Download and drop ```TJAuthErrors.swift```,```TJBioAuthenticator.swift``` and ```TJDefaultMessages.swift``` in your project.
59 | 2. Congratulations!
60 |
61 |
62 | ## Usage
63 |
64 | **Note:** - To use faceID you need to add following lines in your info.plist
65 | ```swift
66 | NSFaceIDUsageDescription
67 | $(PRODUCT_NAME) requires Face ID permission to authenticate using Face recognition.
68 | ```
69 |
70 | ### Check biometric authentication is available or not.
71 |
72 | ```swift
73 | if TJBioAuthenticator.shared.isBiometricAuthenticationAvailable(){
74 | // Bio metric is available, write your code here
75 | }
76 | ```
77 |
78 | ### Check faceID authentication is available or not.
79 |
80 | ```swift
81 | if TJBioAuthenticator.shared.isFaceIDAvailable(){
82 | // FaceID is available, write your code here
83 | }
84 | ```
85 |
86 | ### Authentication using bioMetric.
87 |
88 | ```swift
89 | TJBioAuthenticator.shared.authenticateUserWithBioMetrics(success: {
90 | // Biometric Authentication success
91 | }) { (error) in
92 | // Biometric Authentication unsuccessful
93 | }
94 | ```
95 |
96 | ### Authentication using passcode.
97 |
98 | ```swift
99 | TJBioAuthenticator.shared.authenticateUserWithPasscode(success: {
100 | // Biometric Authentication success
101 | }) { (error) in
102 | // Biometric Authentication unsuccessful
103 | }
104 | ```
105 |
106 | ## Contribute
107 |
108 | We would love you for the contribution to **TJBioAuthentication**, check the ``LICENSE`` file for more info.
109 |
110 | ## Author
111 |
112 | Tejas Ardeshna – [@tejas_ardeshna](https://twitter.com/tejas_ardeshna) – tejasardeshna@gmail.com
113 |
114 | Distributed under the MIT license. See ``LICENSE`` for more information.
115 |
116 |
117 | [swift-image]:https://img.shields.io/badge/swift-3.2-orange.svg
118 | [swift-url]: https://swift.org/
119 | [license-image]: https://img.shields.io/badge/License-MIT-blue.svg
120 | [license-url]: https://github.com/tejas-ardeshna/TJProfileImage/blob/master/LICENSE.md
121 | [travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square
122 | [travis-url]: https://travis-ci.org/dbader/node-datadog-metrics
123 | [codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dad
124 | [codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com
125 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/BioAuth/TJBioAuthenticator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TJBioAuthenticator.swift
3 | // BioAuth
4 | //
5 | // Created by Tejas Ardeshna on 03/11/17.
6 | // Copyright © 2017 Tejas Ardeshna.
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy
9 | // of this software and associated documentation files (the "Software"), to deal
10 | // in the Software without restriction, including without limitation the rights
11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | // copies of the Software, and to permit persons to whom the Software is
13 | // furnished to do so, subject to the following conditions:
14 | //
15 | // The above copyright notice and this permission notice shall be included in
16 | // all copies or substantial portions of the Software.
17 | //
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | // THE SOFTWARE.
25 | //
26 |
27 | import UIKit
28 | import LocalAuthentication
29 |
30 | // success block
31 | public typealias AuthenticationSuccess = (() -> ())
32 |
33 | // failure block
34 | public typealias AuthenticationFailure = ((TJAuthErrors) -> ())
35 |
36 | public class TJBioAuthenticator: NSObject {
37 |
38 | struct Static {
39 | static let instance = TJBioAuthenticator()
40 | }
41 |
42 | // this is the Swift way to do singletons
43 | class open var shared: TJBioAuthenticator
44 | {
45 | return Static.instance
46 | }
47 | }
48 |
49 | // MARK:- Public
50 |
51 | public extension TJBioAuthenticator {
52 |
53 | // checks if Biometric Authentication is available on the device.
54 | func isBiometricAuthenticationAvailable() -> Bool {
55 | var error: NSError? = nil
56 |
57 | if LAContext().canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) {
58 | return (error == nil)
59 | }
60 | return false
61 | }
62 |
63 |
64 | // Biometric authentication
65 | func authenticateUserWithBiometrics(reason: String = "", fallbackTitle: String? = "", cancelTitle: String? = "", success successBlock:@escaping AuthenticationSuccess, failure failureBlock:@escaping AuthenticationFailure) {
66 | let reasonString = reason.isEmpty ? TJBioAuthenticator.shared.defaultBiometricAuthenticationReason() : reason
67 |
68 | let context = LAContext()
69 | context.localizedFallbackTitle = fallbackTitle
70 | if #available(iOS 10.0, *) {
71 | context.localizedCancelTitle = cancelTitle
72 | } else {
73 | // Fallback on earlier versions
74 | }
75 |
76 | // evaluate policy
77 | TJBioAuthenticator.shared.evaluate(policy: LAPolicy.deviceOwnerAuthenticationWithBiometrics, with: context, reason: reasonString, success: successBlock, failure: failureBlock)
78 | }
79 |
80 | // Passcode authentication
81 | func authenticateUserWithPasscode(reason: String = "", cancelTitle: String? = "", success successBlock:@escaping AuthenticationSuccess, failure failureBlock:@escaping AuthenticationFailure) {
82 | let reasonString = reason.isEmpty ? TJBioAuthenticator.shared.defaultPasscodeAuthenticationReason() : reason
83 |
84 | let context = LAContext()
85 | if #available(iOS 10.0, *) {
86 | context.localizedCancelTitle = cancelTitle
87 | } else {
88 | // Fallback on earlier versions
89 | }
90 |
91 | // evaluate policy
92 | TJBioAuthenticator.shared.evaluate(policy: LAPolicy.deviceOwnerAuthentication, with: context, reason: reasonString, success: successBlock, failure: failureBlock)
93 | }
94 |
95 | // checks if Face ID is avaiable on device
96 | func isFaceIDAvailable() -> Bool {
97 | if #available(iOS 11.0, *) {
98 | return (LAContext().biometryType == .faceID)
99 | }
100 | return false
101 | }
102 | }
103 |
104 | // MARK:- evaluate policy
105 | extension TJBioAuthenticator {
106 |
107 | func evaluate(policy: LAPolicy, with context: LAContext, reason: String, success successBlock:@escaping AuthenticationSuccess, failure failureBlock:@escaping AuthenticationFailure) {
108 |
109 | context.evaluatePolicy(policy, localizedReason: reason) { (success, err) in
110 | if success { successBlock() }
111 | else {
112 | let errorType = TJAuthErrors.errorType(err as! LAError)
113 | failureBlock(errorType)
114 | }
115 | }
116 | }
117 | }
118 |
119 | // MARK:- Get default messages
120 | extension TJBioAuthenticator {
121 | // get default bio authentication reason
122 | func defaultBiometricAuthenticationReason() -> String {
123 | return TJDefaultMessages.defaultReasonMessage.rawValue
124 | }
125 |
126 | // get reason after too many failed attempts.
127 | func defaultPasscodeAuthenticationReason() -> String {
128 | return TJDefaultMessages.lockoutReasonMessage.rawValue
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
35 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/TJBioAuthentication/TJBioAuthentication.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 2A988C0D1FE3B95300073DE3 /* TJBioAuthenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A988C0C1FE3B95300073DE3 /* TJBioAuthenticator.swift */; };
11 | B854ECEA1FACC5FD006225B0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B854ECE91FACC5FD006225B0 /* AppDelegate.swift */; };
12 | B854ECEC1FACC5FD006225B0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B854ECEB1FACC5FD006225B0 /* ViewController.swift */; };
13 | B854ECEF1FACC5FD006225B0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B854ECED1FACC5FD006225B0 /* Main.storyboard */; };
14 | B854ECF11FACC5FD006225B0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B854ECF01FACC5FD006225B0 /* Assets.xcassets */; };
15 | B854ECF41FACC5FD006225B0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B854ECF21FACC5FD006225B0 /* LaunchScreen.storyboard */; };
16 | B854ED031FACC633006225B0 /* alertHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B854ECFC1FACC633006225B0 /* alertHelper.swift */; };
17 | B854ED041FACC633006225B0 /* keyBoardHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B854ECFD1FACC633006225B0 /* keyBoardHelper.swift */; };
18 | B854ED0B1FACC65C006225B0 /* TJAuthErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = B854ED081FACC65C006225B0 /* TJAuthErrors.swift */; };
19 | B854ED0D1FACC65C006225B0 /* TJDefaultMessages.swift in Sources */ = {isa = PBXBuildFile; fileRef = B854ED0A1FACC65C006225B0 /* TJDefaultMessages.swift */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXFileReference section */
23 | 2A988C0C1FE3B95300073DE3 /* TJBioAuthenticator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TJBioAuthenticator.swift; sourceTree = ""; };
24 | B854ECE61FACC5FD006225B0 /* TJBioAuthentication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TJBioAuthentication.app; sourceTree = BUILT_PRODUCTS_DIR; };
25 | B854ECE91FACC5FD006225B0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
26 | B854ECEB1FACC5FD006225B0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
27 | B854ECEE1FACC5FD006225B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
28 | B854ECF01FACC5FD006225B0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
29 | B854ECF31FACC5FD006225B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
30 | B854ECF51FACC5FD006225B0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | B854ECFC1FACC633006225B0 /* alertHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = alertHelper.swift; sourceTree = ""; };
32 | B854ECFD1FACC633006225B0 /* keyBoardHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = keyBoardHelper.swift; sourceTree = ""; };
33 | B854ED081FACC65C006225B0 /* TJAuthErrors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TJAuthErrors.swift; sourceTree = ""; };
34 | B854ED0A1FACC65C006225B0 /* TJDefaultMessages.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TJDefaultMessages.swift; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | B854ECE31FACC5FD006225B0 /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | );
43 | runOnlyForDeploymentPostprocessing = 0;
44 | };
45 | /* End PBXFrameworksBuildPhase section */
46 |
47 | /* Begin PBXGroup section */
48 | B854ECDD1FACC5FD006225B0 = {
49 | isa = PBXGroup;
50 | children = (
51 | B854ECE81FACC5FD006225B0 /* TJBioAuthentication */,
52 | B854ECE71FACC5FD006225B0 /* Products */,
53 | );
54 | sourceTree = "";
55 | };
56 | B854ECE71FACC5FD006225B0 /* Products */ = {
57 | isa = PBXGroup;
58 | children = (
59 | B854ECE61FACC5FD006225B0 /* TJBioAuthentication.app */,
60 | );
61 | name = Products;
62 | sourceTree = "";
63 | };
64 | B854ECE81FACC5FD006225B0 /* TJBioAuthentication */ = {
65 | isa = PBXGroup;
66 | children = (
67 | B854ED071FACC65C006225B0 /* BioAuth */,
68 | B854ECFB1FACC633006225B0 /* Extensions */,
69 | B854ECE91FACC5FD006225B0 /* AppDelegate.swift */,
70 | B854ECEB1FACC5FD006225B0 /* ViewController.swift */,
71 | B854ECED1FACC5FD006225B0 /* Main.storyboard */,
72 | B854ECF01FACC5FD006225B0 /* Assets.xcassets */,
73 | B854ECF21FACC5FD006225B0 /* LaunchScreen.storyboard */,
74 | B854ECF51FACC5FD006225B0 /* Info.plist */,
75 | );
76 | path = TJBioAuthentication;
77 | sourceTree = "";
78 | };
79 | B854ECFB1FACC633006225B0 /* Extensions */ = {
80 | isa = PBXGroup;
81 | children = (
82 | B854ECFC1FACC633006225B0 /* alertHelper.swift */,
83 | B854ECFD1FACC633006225B0 /* keyBoardHelper.swift */,
84 | );
85 | path = Extensions;
86 | sourceTree = "";
87 | };
88 | B854ED071FACC65C006225B0 /* BioAuth */ = {
89 | isa = PBXGroup;
90 | children = (
91 | B854ED081FACC65C006225B0 /* TJAuthErrors.swift */,
92 | B854ED0A1FACC65C006225B0 /* TJDefaultMessages.swift */,
93 | 2A988C0C1FE3B95300073DE3 /* TJBioAuthenticator.swift */,
94 | );
95 | path = BioAuth;
96 | sourceTree = "";
97 | };
98 | /* End PBXGroup section */
99 |
100 | /* Begin PBXNativeTarget section */
101 | B854ECE51FACC5FD006225B0 /* TJBioAuthentication */ = {
102 | isa = PBXNativeTarget;
103 | buildConfigurationList = B854ECF81FACC5FD006225B0 /* Build configuration list for PBXNativeTarget "TJBioAuthentication" */;
104 | buildPhases = (
105 | B854ECE21FACC5FD006225B0 /* Sources */,
106 | B854ECE31FACC5FD006225B0 /* Frameworks */,
107 | B854ECE41FACC5FD006225B0 /* Resources */,
108 | );
109 | buildRules = (
110 | );
111 | dependencies = (
112 | );
113 | name = TJBioAuthentication;
114 | productName = TJBioAuthentication;
115 | productReference = B854ECE61FACC5FD006225B0 /* TJBioAuthentication.app */;
116 | productType = "com.apple.product-type.application";
117 | };
118 | /* End PBXNativeTarget section */
119 |
120 | /* Begin PBXProject section */
121 | B854ECDE1FACC5FD006225B0 /* Project object */ = {
122 | isa = PBXProject;
123 | attributes = {
124 | LastSwiftUpdateCheck = 0900;
125 | LastUpgradeCheck = 1000;
126 | ORGANIZATIONNAME = "Tejas Ardeshna";
127 | TargetAttributes = {
128 | B854ECE51FACC5FD006225B0 = {
129 | CreatedOnToolsVersion = 9.0;
130 | LastSwiftMigration = 1100;
131 | ProvisioningStyle = Automatic;
132 | };
133 | };
134 | };
135 | buildConfigurationList = B854ECE11FACC5FD006225B0 /* Build configuration list for PBXProject "TJBioAuthentication" */;
136 | compatibilityVersion = "Xcode 8.0";
137 | developmentRegion = en;
138 | hasScannedForEncodings = 0;
139 | knownRegions = (
140 | en,
141 | Base,
142 | );
143 | mainGroup = B854ECDD1FACC5FD006225B0;
144 | productRefGroup = B854ECE71FACC5FD006225B0 /* Products */;
145 | projectDirPath = "";
146 | projectRoot = "";
147 | targets = (
148 | B854ECE51FACC5FD006225B0 /* TJBioAuthentication */,
149 | );
150 | };
151 | /* End PBXProject section */
152 |
153 | /* Begin PBXResourcesBuildPhase section */
154 | B854ECE41FACC5FD006225B0 /* Resources */ = {
155 | isa = PBXResourcesBuildPhase;
156 | buildActionMask = 2147483647;
157 | files = (
158 | B854ECF41FACC5FD006225B0 /* LaunchScreen.storyboard in Resources */,
159 | B854ECF11FACC5FD006225B0 /* Assets.xcassets in Resources */,
160 | B854ECEF1FACC5FD006225B0 /* Main.storyboard in Resources */,
161 | );
162 | runOnlyForDeploymentPostprocessing = 0;
163 | };
164 | /* End PBXResourcesBuildPhase section */
165 |
166 | /* Begin PBXSourcesBuildPhase section */
167 | B854ECE21FACC5FD006225B0 /* Sources */ = {
168 | isa = PBXSourcesBuildPhase;
169 | buildActionMask = 2147483647;
170 | files = (
171 | B854ED041FACC633006225B0 /* keyBoardHelper.swift in Sources */,
172 | B854ECEC1FACC5FD006225B0 /* ViewController.swift in Sources */,
173 | B854ED031FACC633006225B0 /* alertHelper.swift in Sources */,
174 | 2A988C0D1FE3B95300073DE3 /* TJBioAuthenticator.swift in Sources */,
175 | B854ED0B1FACC65C006225B0 /* TJAuthErrors.swift in Sources */,
176 | B854ECEA1FACC5FD006225B0 /* AppDelegate.swift in Sources */,
177 | B854ED0D1FACC65C006225B0 /* TJDefaultMessages.swift in Sources */,
178 | );
179 | runOnlyForDeploymentPostprocessing = 0;
180 | };
181 | /* End PBXSourcesBuildPhase section */
182 |
183 | /* Begin PBXVariantGroup section */
184 | B854ECED1FACC5FD006225B0 /* Main.storyboard */ = {
185 | isa = PBXVariantGroup;
186 | children = (
187 | B854ECEE1FACC5FD006225B0 /* Base */,
188 | );
189 | name = Main.storyboard;
190 | sourceTree = "";
191 | };
192 | B854ECF21FACC5FD006225B0 /* LaunchScreen.storyboard */ = {
193 | isa = PBXVariantGroup;
194 | children = (
195 | B854ECF31FACC5FD006225B0 /* Base */,
196 | );
197 | name = LaunchScreen.storyboard;
198 | sourceTree = "";
199 | };
200 | /* End PBXVariantGroup section */
201 |
202 | /* Begin XCBuildConfiguration section */
203 | B854ECF61FACC5FD006225B0 /* Debug */ = {
204 | isa = XCBuildConfiguration;
205 | buildSettings = {
206 | ALWAYS_SEARCH_USER_PATHS = NO;
207 | CLANG_ANALYZER_NONNULL = YES;
208 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
209 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
210 | CLANG_CXX_LIBRARY = "libc++";
211 | CLANG_ENABLE_MODULES = YES;
212 | CLANG_ENABLE_OBJC_ARC = YES;
213 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
214 | CLANG_WARN_BOOL_CONVERSION = YES;
215 | CLANG_WARN_COMMA = YES;
216 | CLANG_WARN_CONSTANT_CONVERSION = YES;
217 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
218 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
219 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
220 | CLANG_WARN_EMPTY_BODY = YES;
221 | CLANG_WARN_ENUM_CONVERSION = YES;
222 | CLANG_WARN_INFINITE_RECURSION = YES;
223 | CLANG_WARN_INT_CONVERSION = YES;
224 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
225 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
226 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
227 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
228 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
229 | CLANG_WARN_STRICT_PROTOTYPES = YES;
230 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
231 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
232 | CLANG_WARN_UNREACHABLE_CODE = YES;
233 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
234 | CODE_SIGN_IDENTITY = "iPhone Developer";
235 | COPY_PHASE_STRIP = NO;
236 | DEBUG_INFORMATION_FORMAT = dwarf;
237 | ENABLE_STRICT_OBJC_MSGSEND = YES;
238 | ENABLE_TESTABILITY = YES;
239 | GCC_C_LANGUAGE_STANDARD = gnu11;
240 | GCC_DYNAMIC_NO_PIC = NO;
241 | GCC_NO_COMMON_BLOCKS = YES;
242 | GCC_OPTIMIZATION_LEVEL = 0;
243 | GCC_PREPROCESSOR_DEFINITIONS = (
244 | "DEBUG=1",
245 | "$(inherited)",
246 | );
247 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
248 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
249 | GCC_WARN_UNDECLARED_SELECTOR = YES;
250 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
251 | GCC_WARN_UNUSED_FUNCTION = YES;
252 | GCC_WARN_UNUSED_VARIABLE = YES;
253 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
254 | MTL_ENABLE_DEBUG_INFO = YES;
255 | ONLY_ACTIVE_ARCH = YES;
256 | SDKROOT = iphoneos;
257 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
258 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
259 | };
260 | name = Debug;
261 | };
262 | B854ECF71FACC5FD006225B0 /* Release */ = {
263 | isa = XCBuildConfiguration;
264 | buildSettings = {
265 | ALWAYS_SEARCH_USER_PATHS = NO;
266 | CLANG_ANALYZER_NONNULL = YES;
267 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
268 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
269 | CLANG_CXX_LIBRARY = "libc++";
270 | CLANG_ENABLE_MODULES = YES;
271 | CLANG_ENABLE_OBJC_ARC = YES;
272 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
273 | CLANG_WARN_BOOL_CONVERSION = YES;
274 | CLANG_WARN_COMMA = YES;
275 | CLANG_WARN_CONSTANT_CONVERSION = YES;
276 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
278 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
279 | CLANG_WARN_EMPTY_BODY = YES;
280 | CLANG_WARN_ENUM_CONVERSION = YES;
281 | CLANG_WARN_INFINITE_RECURSION = YES;
282 | CLANG_WARN_INT_CONVERSION = YES;
283 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
284 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
285 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
286 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
287 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
288 | CLANG_WARN_STRICT_PROTOTYPES = YES;
289 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
290 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
291 | CLANG_WARN_UNREACHABLE_CODE = YES;
292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
293 | CODE_SIGN_IDENTITY = "iPhone Developer";
294 | COPY_PHASE_STRIP = NO;
295 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
296 | ENABLE_NS_ASSERTIONS = NO;
297 | ENABLE_STRICT_OBJC_MSGSEND = YES;
298 | GCC_C_LANGUAGE_STANDARD = gnu11;
299 | GCC_NO_COMMON_BLOCKS = YES;
300 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
301 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
302 | GCC_WARN_UNDECLARED_SELECTOR = YES;
303 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
304 | GCC_WARN_UNUSED_FUNCTION = YES;
305 | GCC_WARN_UNUSED_VARIABLE = YES;
306 | IPHONEOS_DEPLOYMENT_TARGET = 11.0;
307 | MTL_ENABLE_DEBUG_INFO = NO;
308 | SDKROOT = iphoneos;
309 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
310 | VALIDATE_PRODUCT = YES;
311 | };
312 | name = Release;
313 | };
314 | B854ECF91FACC5FD006225B0 /* Debug */ = {
315 | isa = XCBuildConfiguration;
316 | buildSettings = {
317 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
318 | CODE_SIGN_STYLE = Automatic;
319 | DEVELOPMENT_TEAM = "";
320 | INFOPLIST_FILE = TJBioAuthentication/Info.plist;
321 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
322 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
323 | PRODUCT_BUNDLE_IDENTIFIER = com.jalsa.TJBioAuthentication;
324 | PRODUCT_NAME = "$(TARGET_NAME)";
325 | SWIFT_VERSION = 4.2;
326 | TARGETED_DEVICE_FAMILY = "1,2";
327 | };
328 | name = Debug;
329 | };
330 | B854ECFA1FACC5FD006225B0 /* Release */ = {
331 | isa = XCBuildConfiguration;
332 | buildSettings = {
333 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
334 | CODE_SIGN_STYLE = Automatic;
335 | INFOPLIST_FILE = TJBioAuthentication/Info.plist;
336 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
337 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
338 | PRODUCT_BUNDLE_IDENTIFIER = com.jalsa.TJBioAuthentication;
339 | PRODUCT_NAME = "$(TARGET_NAME)";
340 | SWIFT_VERSION = 5.0;
341 | TARGETED_DEVICE_FAMILY = "1,2";
342 | };
343 | name = Release;
344 | };
345 | /* End XCBuildConfiguration section */
346 |
347 | /* Begin XCConfigurationList section */
348 | B854ECE11FACC5FD006225B0 /* Build configuration list for PBXProject "TJBioAuthentication" */ = {
349 | isa = XCConfigurationList;
350 | buildConfigurations = (
351 | B854ECF61FACC5FD006225B0 /* Debug */,
352 | B854ECF71FACC5FD006225B0 /* Release */,
353 | );
354 | defaultConfigurationIsVisible = 0;
355 | defaultConfigurationName = Release;
356 | };
357 | B854ECF81FACC5FD006225B0 /* Build configuration list for PBXNativeTarget "TJBioAuthentication" */ = {
358 | isa = XCConfigurationList;
359 | buildConfigurations = (
360 | B854ECF91FACC5FD006225B0 /* Debug */,
361 | B854ECFA1FACC5FD006225B0 /* Release */,
362 | );
363 | defaultConfigurationIsVisible = 0;
364 | defaultConfigurationName = Release;
365 | };
366 | /* End XCConfigurationList section */
367 | };
368 | rootObject = B854ECDE1FACC5FD006225B0 /* Project object */;
369 | }
370 |
--------------------------------------------------------------------------------