1

Xcode 9.3 (beta) showing an error for enum LABiometryType, which was working fine with Xcode 9.2 with check available(iOS 11.0, *).

Here is error message:

'LABiometryType' is only available on iOS 11.0.1 or newer

enter image description here

Here is my existing code:

if #available(iOS 11.0, *) {
    if (laContext.biometryType == LABiometryType.faceID) {
        //localizedReason = "Unlock using Face ID"
        print("FaceId support")
    } else if (laContext.biometryType == LABiometryType.touchID) {
        //localizedReason = "Unlock using Touch ID"
        print("TouchId support")
    } else {
        //localizedReason = "Unlock using Application Passcode"
        print("No Biometric support")
    }
} else {
    // Fallback on earlier versions
}

Problem is: If I replace #available(iOS 11.0, *) with #available(iOS 11.0.1, *) as suggested in error message, then how to handle Face-id biometry (LABiometryType.faceID) for iOS 11.0.

Krunal
  • 77,632
  • 48
  • 245
  • 261
  • The Apple docs are incorrect about the availability of `LABiometry` type beginning with iOS 11.0+... or at least the omission of the 11.0.1+ specificity is misleading. At least Xcode 9.3 now shows compiler warnings about it. I wound up discovering this myself through a small of set crashlogs reading `-[LAContext biometryType] unrecognized selector sent to instance` that only occurred on iOS 11.0.0 – markedwardmurray Apr 13 '18 at 06:57

1 Answers1

3

You don't need to handle Face ID on iOS 11.0 because the iPhone X was released with iOS 11.0.1. There is no iOS device on iOS 11.0 that has Face ID capabilities.

See https://en.wikipedia.org/wiki/IOS_version_history#iOS_11_0 and https://en.wikipedia.org/wiki/IPhone_X

naglerrr
  • 2,809
  • 1
  • 12
  • 24
  • The iPhone X was publicly launched with iOS 11.1.0 to my recollection. I believe this Wikipedia page is mistaken. I would suspect that beta versions of the iPhone X uses for internal testing and press events were seeded with iOS 11.0.x prior to Nov 3 launch date. But otherwise, yes, FaceID does not need to be handled in iOS 11.0.0 – markedwardmurray Apr 13 '18 at 06:54
  • 1
    No. The inital batch of iPhone X shipped with 11.0.1 installed. I had such an iPhone myself. Here is another reference: https://9to5mac.com/2017/11/03/ios-11-2-beta-iphone-x/ – naglerrr Apr 17 '18 at 12:28
  • Cool I didn't know. Thanks for the second link ^_^ – markedwardmurray Apr 17 '18 at 14:46