I would like to bind the count attribute of a MutableObservableArray to a UILabel, so that the label is visible when count = 0 but I can't find any relevant examples or info. In other words, I want a label with the text "No Contents" to be visible when the array is empty and to be hidden when the array isn't empty.
Asked
Active
Viewed 126 times
1
-
1Just to clarify you want a label to bind to the current .count value of an array, even if the array.count = 0? – Casey West Oct 30 '17 at 17:27
-
I edited my question to hopefully make things clearer. – Melodius Oct 30 '17 at 17:53
-
Does a simple if/else check for the array.count value not work for some reason? i can post an answer of this if you'd like to try. – Casey West Oct 30 '17 at 18:00
-
Please do post an answer if it is a binding. But I'm not asking for a static test to set the visibility of the label. – Melodius Oct 30 '17 at 18:06