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?

191 questions
2
votes
0 answers

Best way to programmatically set a dynamic height of a collection view header?

I have a view HeaderView that is subclassing UICollectionReusableView and which is a UIStackView arranging some subviews with labels. The number and texts of those labels depend of the information requested to a service. Such view is registered to a…
AppsDev
  • 12,319
  • 23
  • 93
  • 186
2
votes
1 answer

UICollectionViewLayout: add DecorationView only to specific cells

I've developed a custom CollectionViewLayout which uses DecorationView to show shadows behind the cells. However, I'd like to add this decoration only to some cells. The UICollectionView is vertical, but it may contain an embedded horizontal…
2
votes
0 answers

awakefromnib not called for UICollectionReusableView when using RxSwift datasource

I'm using RxSwift, I managed to create the dataSource and I retrieve cells correctly. Problem is with the section headerView. I have created a UICollectionReusableView class, attaching outlets from storyboard. The problem is that I retrieve the…
2
votes
3 answers

CollectionView method 'referenceSizeForHeaderInSection' throws exception

I am trying to create headers for my collectionView with dynamic height. But when I implement "referenceSizeForHeaderInSection", the app crashes with the following exception: Terminating app due to uncaught exception…
2
votes
4 answers

Display Section Header UICollectionReusableView

I was working on iOS application and I have several problem about using UICollectionView cell. This time, I want to ask about how to display the section header of UICollectionView (UICollectionReusableView) I already implement the function like…
christ2702
  • 473
  • 6
  • 12
  • 26
2
votes
2 answers

Why Collection Reusable View not shown?

I would like to create UICollectionView with header. I set Collection Reusable View on mainStoryBoard but, nothing is shown on device. I tried to search but could not find out why it is not appearing. I Main Story Board On device import…
2
votes
0 answers

SIGABRT error trying to call function in another class?

Alright, I have tried protocols (see Swift: collectionviewHeader delegate not working?) but I am now attempting a simpler approach to call a function from another class, but no matter what I do I get a SIGABRT error. I have my main view controller…
blue
  • 7,175
  • 16
  • 81
  • 179
2
votes
1 answer

How to use a UIView Subclass as a UICollectionView footer

I am looking to use a UIView subclass as a collection view footer (UICollectionReusableView). Since the class has already been written as a UIView func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String,…
3254523
  • 3,016
  • 7
  • 29
  • 43
2
votes
2 answers

Swift: Header of UICollectionViewController overlaps cells

I have a UICollectionViewController and want to add a custom header. I checked Section Header in the Interface Builder within my CollectionViewController and implemented in my subclass of it the viewForSupplementaryElementOfKind function. override…
2
votes
2 answers

no UICollectionViewLayoutAttributes instance for -layoutAttributesForSupplementaryElementOfKind:

The title is the error I'm getting and I have no idea why, but here is some information so hopefully someone on here can elucidate me. I have subclassed UICollectionViewFlowLayout as this saves me calculating the frames for the cell's myself…
2
votes
2 answers

Why does "switch" statement not work in setting UICollectionView's header?

I want to set up the collection view's header, and thus implemented the method func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView. …
Blaszard
  • 30,954
  • 51
  • 153
  • 233
2
votes
0 answers

Multiline label in UICollectionReusableView only appearing as 1 line

I've got a nib: From top to bottom, the constraints are: vertical space 15, priority 1000 title label compression resistance priority 1000 vertical space 3, priority 1000 subtitle label compression resistance priority 1000 vertical space 15,…
1192805
  • 988
  • 2
  • 10
  • 26
2
votes
1 answer

How to temporarily stop certain UITableViewCell's from being reused? (or uniquely identify a cell even if its been reused)

I currently have a set up where tapping a cell causes an activity indicator to come up on the cell while a network process is being done. Once it finishes, the cell automatically updates its UI. The problem is, while this is going on, if a user…
gadu
  • 1,816
  • 1
  • 17
  • 31
2
votes
1 answer

Swift UICollectionView header not appearing properly

The headers of the UICollectionView are not appearing properly. I have added one UILabel to the headers and it should display the section number. When I debug the viewForSupplementaryElementOfKind everything look alright. I have looked at different…
tim_yng
  • 2,591
  • 4
  • 18
  • 20
2
votes
2 answers

UICollectionReusableView Header not resizing on rotation - constraints?

I have a UICollectionReusableView for a UICollectionView Header Section in code as follows: var headingLabel: UILabel! override init(frame: CGRect) { super.init(frame: frame) headingLabel = UILabel(frame:…