-1

I was using this function to detect A9 device or higher in the code:

    public static var gpuFamily3AndHigh:Bool = {
      return ARConfiguration.isSupported //Hack to know A9 or more
    }

But now Apple is rejecting the code since the app has no ARKit features. How do I identify it without using ARKit on both iOS 13 and iOS 12. On iOS 13, I see I can do:

  public static var gpuFamily3AndHigh:Bool = {
   // return ARConfiguration.isSupported //Hack to know A9 or more
    
    guard let device = MTLCreateSystemDefaultDevice() else { return false }
    
    return device.supportsFamily(.apple3)
}()

But I don't know if .apple3 is the right constant than .common3, and also what do I do on iOS 12?

Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131

1 Answers1

1

If I read this document correctly, you should check for the supported family (as you do) when the API is available and fall back to checking for a specific feature set otherwise.

And if you really want to check for the A9 and above specifically, the family .apple3 and the feature set .iOS_GPUFamily3_v1 seem to be the way to go.

Frank Rupprecht
  • 9,191
  • 31
  • 56