Dynamic Buttons Collection View
I am trying to implement a collection view that contains a series of
buttons for each cell.
I have been able to dynamically add the buttons to each collection view,
depending on necessary number of buttons required. Anywhere from 1 to 7
small buttons per cell.
I am unable to determine the best way to link the value of the button
state to the model of my app.
Each button can cycled through 4 states, each has a different image for
the state.
I am able to determine what cell / object in the data model is selected
but cannot figure out how to link the button to the data model.
I have tried adding a category to the UIButton class and have properties
that store the reference to the model - but cannot get it to work.
I am assuming I will need to sub class UIButton instead ?
Any ideas are welcome.
No comments:
Post a Comment