Akash G
Akash G

Reputation: 3

Specifying constraints on Xcode

I would like to know whether there is any way to specify constraints explicitly for a particular device(iPhone 6,iPad Air etc..) on Xcode interface builder.

Upvotes: 0

Views: 1591

Answers (1)

Adnan Aftab
Adnan Aftab

Reputation: 14477

Yes, you can assign constraint to particular device size, it's not a specific device like iPhone 5Se or iPhone 6 but is kind of specific size classes, like compact or regular.

Click on view as on the bottom left of storyboard and you will see different options of devices size, now on the bottom right of storyboard you can see vary for traits.

enter image description here

Now if you click height you can see devices which will effect and if you add any constraint or view here it will only affect these devices.

enter image description here

If you deselect height and select width, you will see different set of devices

enter image description here

You can use mix and match and set different constraints and can add different views for different size classes.

For more info on this please visit following links

Upvotes: 4

Related Questions