Sachin Khaire Sachin Khaire - 1 month ago 16
iOS Question

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 !!

Answer

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