T
T
Tommy322017-02-13 10:56:35
Swift
Tommy32, 2017-02-13 10:56:35

Is it possible to set conditions in collectionView?

Is it possible to create conditions when entering a collectionView or TableView, and if the conditions are else, then not display our cell? And then I set the conditions, but if it is not met, then empty cells will be printed, if hidden, they will not be visible, but they will take up space in the collection

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
ManWithBear, 2017-02-13
@Tommy32

You are solving the wrong problem. Collection/Table should not know anything about your conditions (and they don't care). They just take data from you and display it.
Accordingly, all display / hide logic should be decided in the business logic layer.
If you don't want to show something, don't give it to the table.
Of course, you can just set the dimensions / height of the unwanted element to 0, but you need to kick for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question