Use UICollectionView or an Outlet Collection

Hi! I am doing an iPad App and need a field with 4 x 5 Buttons.
So my question in basic is: Is it better to use a UICollectionView for the buttons or generate an Outlet Collection an wire up all the buttons to the collection?
Later I would like to animate the buttons, when the view with the collection (or UICollectionView) appears on the screen. My buttons are embedded in stack views if am going to use an outlet collection.
So witch way would be the better way to do this?

In these cases you'd better choose UICollectionView instead of outlet collection:

  • The number of buttons is not fixed. Depending on different status or different data set.

  • Buttons need Drag and drop features.

  • Buttons need to have appear and disappear or order reorganize animation.

  • A large number of buttons and all the buttons have a same pattern.

If each button have individual function and the number of the buttons is fixed. You can use both of them. Depending on which one requires less code.

I hope it'll be helpful.

1 Like

Hey! Thank you! Very clear answer!

Terms of Service

Privacy Policy

Cookie Policy