1

I am currently using FBSnapshotTestCase and Nimble-Snapshot to take snapshots of ViewControllers in my project.

I know in the Realm UI and Snapshot Testing Video Luis mentioned that we can test views across devices (iPhone5 vs iPhone 6+ etc).

I want to know which device I am running on within simulator, but when I print out the model name using this extension found at this post iOS: How to determine the current iPhone/device model in Swift?
let modelName = UIDevice.current.modelName

It would just say I am running in Simulator.

I was following this Stack Overflow post How to determine the device running in the simulator? but using FBSnapshotTestCase is not necessarily related to "functionalities available". Has anyone ran into a similar problem?

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

Looks like UIDevice.current.name will give you what you're looking for when it comes to the simulator. (However, on a device it will instead be what the owner has named their device in the settings).

CodenameDuchess
  • 1,221
  • 18
  • 24