Aadil Imran
Aadil Imran

Reputation: 115

Difference between "Use auto layout" and "Use size class" in xcode 6.1?

What is the difference between the "Use auto layout" and "Use size class" on storyboards in xcode 6.1?

Upvotes: 3

Views: 5194

Answers (4)

Hemraj Jhariya
Hemraj Jhariya

Reputation: 114

Size classes is used when we design app more than devices to make alignment of elements according to device design.like portrait and landscape design differ to each other.

Auto Layout is needed. In Storyboard, you place a button right in the center of the view. Run the app on both iPhone Retina (3.5-inch) and iPhone Retina (4-inch) simulators. basically its used for same alignment on different size device.

Upvotes: 1

Shilpa
Shilpa

Reputation: 340

In easy way we can say Autolayout is used for displaying same layout comatible on different different iPhone/iPad screen sizes (ex. Keep button in center for all screen sizes) while through Autoresizing classes we can set a different layout for a particular screen size. (ex. we want button should be on top for only iPhone portrait mode and for all other screen sizes (iPad landscape & portrait/iPhone landscape) it should be in center).

Upvotes: 1

Shilpa
Shilpa

Reputation: 340

“Auto Layout is a system that lets you lay out your app’s user interface by creating a mathematical description of the relationships between the elements. You define these relationships in terms of constraints either on individual elements, or between sets of elements.”

Size Classes let you set different constraints for certain screen sizes. This let’s you go beyond basic stretching layouts.In Xcode 6 Apple introduced Size Classes.

Upvotes: 6

Linuxios
Linuxios

Reputation: 35788

They are two entirely different things.

"Use Auto Layout" determines whether a storyboard uses the Auto Layout features introduced in iOS 6 to automatically layout your interface using constraints.

"Use Size Classes" enables a new Xcode 6 feature called size classes that lets you use Auto Layout to build one interface for all devices and customize constraint constants, and certain views and constraints for different interface idioms while reusing the general layout. It saves the work and repetitiveness of having to build and maintain both MainiPhone and MainiPad storyboards.

Upvotes: 3

Related Questions