1

I just learned about 'PureLayout' as a 3rd-party Autolayout-Constrait application available on Github.

Is there any way work with PureLayout via the Interface Builder? Are there any tutorials or reference docs to get started with PureLayout?
I'm being introduced via the on-line code example.

Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105

1 Answers1

1

PureLayout is a library that helps you write Auto Layout code (specifically, creating and activating layout constraints). As such, it doesn't really make sense to ask "Can it be used via Interface Builder?". Under the hood, PureLayout utilizes the same UIKit and Cocoa Touch APIs that Interface Builder does to create constraints -- the difference is simply whether you're specifying these constraints in IB (which generates XML that instantiates NSLayoutConstraint objects at runtime), or in code (which directly instantiates the same objects at runtime).

If you're using Interface Builder, you are creating your Auto Layout constraints using the UI options available. There are some things that you can do with PureLayout that cannot be done in IB (for example, runtime changes of constraints, or easily distributing many views across the screen). If you want to do something like that, you can definitely mix and match both IB and PureLayout -- just create outlets for the views you wish to manage in code, and then add constraints in code. (There are some caveats to be aware of, such as needing to specify placeholder constraints for partially-constrained IB views.)

If you want to use PureLayout only, you can create all of your views in code and also manage the layout completely in code as well. There is absolutely nothing in iOS development that requires Interface Builder to implement.

Community
  • 1
  • 1
smileyborg
  • 30,197
  • 11
  • 60
  • 73