I`m trying to show a message only when my collection view is empty. Well, I try set return 1 when my if is true but when I have this, it only show one item in my collection view
Why don't you use:
open var backgroundView: UIView?
// will be automatically resized to track the size of the collection view and placed behind all cells and supplementary views.`
You can show it whenever collection is empty. Example:
var collectionView: UICollectionView!
var collectionData: [Any] {
didSet {
collectionView.backgroundView?.alpha = collectionData.count > 0 ? 1.0 : 0.0
}
}