Category: Auto Layout

  • Auto Layout in iOS

    Using Auto Layout feature developers can align UI controls for different devices, screen sizes and orientation. This reduces the code to be maintained and makes life easy for the developers. Auto Layout solves UI design issues by creating relationship between the UI elements. This follows constraint based layout system where you can define contraints for…

  • Unable to simultaneously satisfy constraints.

    A common error that we would see when using Auto Layout is Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don’t want. Debugging the verbose shown in the console might look difficult but if you closely go through the messages you should be able…

  • Content Priority in Auto Layout

    Auto Layout brings in lots of good features to ease the life of an iOS developer when designing User Interfaces. In this example, we will see how to use Content Priorities such as Content Hugging and Comrpession Resistance. I have created a project with Single View Template and dispayed Size Classes as we are going…

  • How to programmatically add AutoLayout constraints?

    AutoLayout solves the mystery when designing app for more than one screen size and for both Portrait and Landscape orientation. This is done by adding constraints to the views using various Auto Layout options available as part of Interface Builder. As an iOS developer, you can also add these constraints programmatically using NSLayoutConstraints or Visual…

  • Adaptive Layout in iOS

    Adaptive Layout was introduced in iOS 8 to address the problem of designing user interface for different devices and screen sizes. In the earlier version of iOS, we had to maintain different storyboards for iPad and iPhone and with Adaptive Layout we just need one storyboard for all the devices. Some of the main components…