Search code examples
iosswiftdevice-orientation

How to change constraints when device is in landscape mode?


Is there a way to change the constraints? I want to change the height, centerX and centerY of the button if the device is in landscape mode.


Solution

  • You can use different constraints by using Size classes. Size classes allows you to add different constraints for various modes i.e landscape and Portrait for various devices.