Search code examples
iosobjective-cnslayoutconstraintios-autolayout

Creating views dynamically with autolayout constraints? in Objective-C?


  • UIStackView(main)
    • UIView(sub)
      • UILabel,UIButton etc.
    • UIview (sub)
    • may be others views

All these are programmatically with constraints. And may be UIView of UILabel or UIButtons are create into loops. One by One.

Please help !!


Solution

  • If you want to create these views programatically, i would recommend these two libraries. They make adding/removing/updating/managing constraints very easy.

    Objective-c

    https://github.com/SnapKit/Masonry

    Swift

    https://github.com/SnapKit/SnapKit