Skip to content

Instantly share code, notes, and snippets.

@vishw33
Created May 21, 2018 07:41
Show Gist options
  • Select an option

  • Save vishw33/870506f123ae7cf57695da7eb487b4ba to your computer and use it in GitHub Desktop.

Select an option

Save vishw33/870506f123ae7cf57695da7eb487b4ba to your computer and use it in GitHub Desktop.

Revisions

  1. vishw33 created this gist May 21, 2018.
    13 changes: 13 additions & 0 deletions auth.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    static func isDeviceSupportedforAuth () -> Bool
    {
    let context = LAContext()
    var policy: LAPolicy?
    policy = .deviceOwnerAuthentication
    var err: NSError?
    guard context.canEvaluatePolicy(policy!, error: &err) else
    {
    return false
    }
    return true

    }