stuffrabbit / SwiftSpreadsheet

Spreadsheet CollectionViewLayout in Swift. Fully customizable. 🔶
MIT License
641 stars 39 forks source link

DecorativeView #6

Closed bdhaeseleer closed 5 years ago

bdhaeseleer commented 5 years ago

I'm pretty sure this is a dumb question, but is there a way to update/set the label into a decorative view programmatically ? I didn't find any example about it in the project and I don't understand how I may access to the label in order to change "Revenue" by something else

Thanks in advance

stuffrabbit commented 5 years ago

Hey, the question isn’t dumb at all. Unfortunately, there is no way of simply updating decoration views once they are set. You could try to Invalide/initialize a new collection view layout and assign it to your collection view (this would mean that everything gets redrawn) anytime you want to change the decoration view. But I am not sure if this works properly. Hope this helps.

Best regards Wojtek

bdhaeseleer commented 5 years ago

Thanks for you answer, actually I based my solution on : https://stackoverflow.com/a/39218108 . This isn't very modular but it works in my case where I only need a topLeft decoration.

stuffrabbit commented 5 years ago

That looks interesting. Thanks for the hint.