Latest 0.3.0
Homepage https://github.com/William-Weng/WWTouchIdTesting
License MIT
Platforms ios 10.0
Frameworks UIKit, LocalAuthentication
Authors

使用TouchID / FaceID的功能封裝

Swift 4.2 Version Platform License

使用TouchID / FaceID的功能封裝 (上傳至Cocoapods)

使用範例

IBOutlet

import UIKit
import WWTouchIdTesting

class ViewController: UIViewController {

    @IBOutlet weak var successLabel: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    /// TouchID / FaceID 測試 (info.plist => NSFaceIDUsageDescription)
    @IBAction func touchIdAction(_ sender: UIButton) {

        let myBiometryType = WWTouchIdTesting.run(reason: "ID辨識測試") { policyResult in

            DispatchQueue.main.async {
                switch policyResult {
                case .failure(let error):
                    self.successLabel.backgroundColor = .red
                    print("error = (error.debugDescription)")
                case .success(let isOK):
                    self.successLabel.backgroundColor = .green
                    print("isOK = (isOK.debugDescription)")
                }
            }
        }

        successLabel.text = "(myBiometryType.toString())"
    }
}

Latest podspec

{
    "name": "WWTouchIdTesting",
    "version": "0.3.0",
    "summary": "WWTouchIdTesting is TouchID / FaceID package. (u4f7fu7528TouchID / FaceIDu7684u5c01u88dd)",
    "homepage": "https://github.com/William-Weng/WWTouchIdTesting",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u7fc1u79b9u658c(William.Weng)": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "ios": {
        "vendored_frameworks": "WWTouchIdTesting.framework"
    },
    "source": {
        "git": "https://github.com/William-Weng/WWTouchIdTesting.git",
        "tag": "0.3.0"
    },
    "frameworks": [
        "UIKit",
        "LocalAuthentication"
    ]
}

Pin It on Pinterest

Share This