CreateML not available on iOS Simulator

One part of my app uses CreateML but I still need to test the UI on other screen sizes with the simulator. I tried using this condition but still get the same error.

#if os(iOS)
import CreateML // CreateML is not available when building for iOS Simulator. Consider using `#if os(iOS)` to conditionally import this framework when building for iOS.
#endif

CreateML is not on simulator now, please consider using #if targetEnvironment(simulator) to do a platform check.

CreateML not available on iOS Simulator
 
 
Q