Post

Replies

Boosts

Views

Activity

Refreshing / Reloading Data of Supplementary View (Header & Footer) for Collection View
I have deployed 2 Supplementary Views for Header and Footer views for my collection view. Header '0' has UILabel text which dynamically sets data dynamically after transitioning to push secondary view controller. But I am having problem that when UILabel in header loads again after returning and taking data from secondary view controller collection view get updated but Header and Footer Supplementary views has overlapping of old and new data...!!! How to fix overlapping of data and 'Reload Supplementary Views' for Header and Footer?
3
1
3.7k
Apr ’21
Rearrange collection view cells within it's section
I have used UICollectionView Cells for my app. It is populated by Arrays. I have two CollectionView Sections. Section '0' & Section '1' has it's own cells populated with arrays. There are multiple cells in section 1. I want to enable user to rearrange cells within section 1. User should not be able to move cell from section 1 to section 0. I am using following code but It is giving me errors... I tried searching on the web but I didn't got the answer so I am posting it here for help... override func collectionView(_ collectionView: UICollectionView, moveItemAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { let sourceSection = sourceIndexPath.section let destSection = destinationIndexPath.section if (sourceSection destSection) { let tempInputDataArray = inputDataArray.remove(at: sourceIndexPath.item) inputDataArray.insert(tempInputDataArray, at: destinationIndexPath.item) UserDefaults.standard.set(inputDataArray, forKey: "KeyForInputDataArray") for element in inputDataArray { print(element) } } else { } }
7
0
2.0k
Apr ’21