Skip to content

Changing the logic of allowableReuseDuration property #38

@lmvdev

Description

@lmvdev

There are 2 issues when using allowableReuseDuration:

  • value 0 is not equal to disabling the property;
  • only one instance of LAContext is uses.

It can get trouble for example in situation when I set allowableReuseDuration and start scanning a lot of times - each next scanning will use the first result.

Could you change the logic of allowableReuseDuration?

  • remove optional type (from TimeInterval? to TimeInterval);
  • add the default value 0 to allowableReuseDuration;
  • remove didSet handler from allowableReuseDuration;
  • set the touchIDAuthenticationAllowableReuseDuration property right after LAContext creation.

For example

var allowableReuseDuration: TimeInterval = 0

// context
let context = LAContext()
context.touchIDAuthenticationAllowableReuseDuration = allowableReuseDuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions