JScarry
JScarry

Reputation: 1507

How can you identify an iPad without a home button?

I need to adjust the area where my game plays whenever it runs on a device without a home button.

I can identify all of the iDevices by their dimensions, but the new iPad 12.9" has the same dimensions as the old one.

This code works but I’m looking for something more future proof that doesn’t rely on the name. Any thoughts?

if ( [ [[UIDevice currentDevice] name] isEqualToString: @"iPad Pro (12.9-inch) (3rd generation)" ] ) {
    device = LFDeviceTypePadPro12_9;
}

Upvotes: 1

Views: 249

Answers (1)

Josh Homann
Josh Homann

Reputation: 16327

You can use LAContext .biometryType to get the Biometric login type supported by the device. On old devices it's going to be .none or .touchId, while newer devices have .faceID. The faceId devices have no home button; everything else does.

Upvotes: 5

Related Questions