Duck
Duck

Reputation: 35933

Do we need autolayout and constraints for an OSX app that has a fixed interface size?

Think before you answer because this question may be deeper than it appears.

Do we really need autolayout and constraints for an OSX app that has a fixed interface size?

The only reason for constraints and autolayout on iOS is the different sizes when you rotate the application or between devices but on OSX the reason may be scaling the interface, because there is no rotation. In this specific case the interface has a fixed size.

Upvotes: 0

Views: 79

Answers (2)

MacUserT
MacUserT

Reputation: 1943

I'm not sure if I thought deep enough or onderstand the interface builder enough, but I found out that the buttons keep the size I want them to if I use the constraints. Without constraints and word wrap on, your (my) buttons resize to fit around the text.

Also when you need to resize subviews to fit the content they're showing and you don't have constraints set, you tend to get a messy interface inside your window. My experience is that constraints not only help you when your window resizes. It keeps your interface objects placed correctly in position of one another and with the right size even when content in the different view objects change.

Upvotes: 1

zpasternack
zpasternack

Reputation: 17898

You interface is really fixed? No resizable windows or anything? If so, nope, you totally don't need autolayout. Just disable the "Use Auto Layout" checkbox in the File Inspector for your xib. That will allow you to use the old-fashioned Autoresizing masks, which, if your app truly has a fixed interface size, you don't even need that.

Layout your interface in IB however you like, and you're done.

Upvotes: 1

Related Questions