I am trying to get a secondViewController to appear after I (1) click a button and (2) verify a condition.
In my if statement that verifies the condition I use a performSegue to pull up the secondViewController ("dispenseScreen"). However, when I do this it pulls up a window that just sits on top of the home screen but is not replacing it.
Does anyone know what I need to do to completely replace the home screen?
This is my code:
@IBAction func touchID(_ sender: Any)
{
let context:LAContext = LAContext()
//Removes Enter Password during failed TouchID
context.localizedFallbackTitle = ""
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil)
{
context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "We require your TouchID", reply: {(wasCorrect, error) in DispatchQueue.main.async {
self.isBiometryReady()
if wasCorrect {
self.performSegue(withIdentifier: "dispenseScreen", sender: self)
print("Correct")
}
else {
print("Incorrect")
}
}
})
} else {
//Enter phone password if too many login attempts
//Add message alerting user that TouchID is not enabled
}
}