Questions tagged [uicollectionreusableview]

The UICollectionReusableView class defines the behavior for all cells and supplementary views presented by a collection view.Available in iOS 6.0 and later. It should be tag only issues related with [tag:uicollectionreusableview].

UICollectionReusableView : Reusable views are so named because the collection view places them on a reuse queue rather than deleting them when they are scrolled out of the visible bounds. Such a view can then be retrieved and repurposed for a different set of content.This is declared in Apple's UIKit framework and available in iOS 6.0 and later

This class is intended to be subclassed. Most methods defined by this class have minimal or no implementations. You are not required to override any of the methods but can do so in cases where you want to respond to changes in the view’s usage or layout.

Source: UICollectionReusableView Class Reference

Related tags:

Related Stack Overflow questions:

  1. Removing empty space, if the section header is hidden in the UICollectionView

  2. How to detect scrolling to a new section in a UICollectionView?

183 questions
4
votes
1 answer

Collection view within another collection view: section header or cell?

I already have a UICollectionView which scrolls vertically and shows a collection of custom UICollectionViewCells which have a fixed size. Now I've been asked for showing another UICollectionView in top of all other cells, which should scroll…
4
votes
1 answer

How do I reload cells in UICollectionView without reloading the header?

I am trying to update the content of the cells in a UICollectionView based on what the user inputs into a textField in the header. I have looked at other similar questions here but none of their answers have seemed to work.I even tried implementing…
4
votes
1 answer

Swift 3 UICollectionView reusable section header will not display

In swift 3 with Xcode 8.2 I can't get a reusableHeaderView to display with UICollectionView. I placed breakpoints at various points in my header view file and they are never tripped. Here is my code. import UIKit class WishListViewController:…
markhorrocks
  • 1,206
  • 12
  • 59
  • 113
4
votes
2 answers

How can UICollectionView supplementary views be inserted or deleted correctly

Short question: Is there a way to add and remove supplementary views like cells and section in a performBatchUpdates: block similar to the insertItemsAtIndexPaths: deleteItemsAtIndexPaths: or even reloadItemsAtIndexPaths: methods? Long…
4
votes
3 answers

Error casting value of type 'UICollectionReusableView' to 'MyApp.CSSectionHeader'

I have the following class: class CSSectionHeader: UICollectionReusableView { @IBOutlet var textLabel: UILabel! } I'm then trying to cast it like the following: override func collectionView(collectionView: UICollectionView,…
fulvio
  • 24,168
  • 20
  • 122
  • 198
4
votes
0 answers

UICollectionView Horizontal Sticky Headers

I'm implementing a UICollectionView with a set of sections and I scroll the items horizontally. I was to accomplished this but I having a hard time adding a Section header on top of the items. I tried to add a Section Header accessory but it was…
4
votes
1 answer

UICollectionReusableView height based on UILabel text

I have a UICollectionReusableView which I would like to show in the header of my collectionView. I created a XIB file for the header and and dragged a UICollectionReusableView and laid out the elements inside that using auto layout. 2 of the labels…
4
votes
2 answers

Difference between dequeueReusableCellWithReuseIdentifier: and cellForItemAtIndexPath:

I have been wondering why my code works well with cellForItemAtIndexPath: & not with dequeueReusableCellWithReuseIdentifier: while fetching collection view cells. Here is my code: This one works Fine: NSInteger numberOfCells = [self.collectionView…
4
votes
1 answer

How can I test whether the UICollectionView header is currently in the view rect?

I need to know if the UICollectionView header supplementary view is currently in view in order to force it to refresh/update when an app setting/preference is changed. If the header is not in view, once scrolled to, the header will get drawn…
4
votes
1 answer

Error when adding Supplementary Header View to UICollectionView

I am getting the following error implementing the supplementary Header View Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no UICollectionViewLayoutAttributes instance for…
4
votes
1 answer

UICollectionView Header Compatible Views

I've constructed an UICollectionView in a storyboard and implemented all of its required data source and delegate methods in the view controller. In the storyboard, I checked the Section Header property on the collection view and set the header…
The Kraken
  • 3,087
  • 5
  • 25
  • 65
3
votes
3 answers

How to dynamically add labels and buttons in section header of UICollectionView?

Please help me how I can add labels horizontally and similarly buttons horizontally but each button should align at down of each label like a another section. This should happen dynamically in the header of the UICollectionView as the number of…
3
votes
5 answers

UICollectionview scrollToItemAtIndexPath, not loading visible cells until animation complete

I have a UICollectionView with 142 Cells. 7.5 are visible at any one time. I'm moving a cell from indexPath 0 to say 100. But I also want to scroll to that new position. The code below works fine. But it animates the move and scroll, but then loads…
3
votes
3 answers

UICollectionViewCells deque returns wrong cell

I have a CollectionView, I use the cells to display videos and I also store some other data on variables. And whenever I scroll I reuse previous cells using the following code: let cell =…
3
votes
1 answer

Popover segue from UICollectionView ReusableView (header)

I added a UIButton to a UICollectionView header. I like to instigate a popover segue from the button to a UITableViewController. I control-drag from the button on the collection view header to the tableView Controller and choose present as popover…
1 2
3
12 13