IOS – How to add preview devices to Interface Builder in Xcode to retrieve the device’s code

iosipadpreviewxcodexml

Is there any way to add devices to the selection in the lower left corner?

enter image description here

I want to add the iPad Air and iPad Mini, so that I can view their ID (e.g. for iPhone 4 "retina3_5") when I view the .xib file as code.


My actual problem is that I am generating .xib files from a model and don't want Xcode to be asking like this

Xcode asking for an initial device

for an initial device when viewing the generated view in Xcode. The only and therefore initial device for this view is set in the model.

I already added the following lines which set the initial device:

<device id="retina4_0" orientation="portrait">
    <adaptation id="fullscreen"/>
</device>

The only problem is that I don't know the identifiers for iPad Air and iPad Mini. I know their resolution is the same as that of the iPad Pro 9.7" so I might as well just use the ID of the Pro but that doesn't feel completely right.

Any suggestions? I already spent a lot of time on searching how to add devices (the only suitable answer I found said press + in the lower left corner, but there is none for me) and for the keys of i-devices but without luck. Apple seems not have documented the xib-format at all.

Best Answer

There's no way nor need to add devices there. The devices presented there cover all the available device resolutions you should care about and that's what is it for.

If you want to add simulated devices for you to test on you can go to Xcode->Window->Devices and click on the + on the lower left corner.

I'm guessing that's the + sign you saw while searching about it