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
0
votes
0 answers

Most Performant Method for Divider Line in UICollectionReusableView

I have a UICollectionReusableView that I’m using for section headers. It looks like this: I know of a few ways to add the divider line, but am honestly not sure which would be the most performant given a UICollectionView with many sections and…
JWK
  • 3,345
  • 2
  • 19
  • 27
0
votes
1 answer

Update cell content in UICollection2 from UICollection 1

I have 3 UICollections. The main UICollection that holds 2 cells which each contains a UI Collection. In the first cell, from the main UICollection, a vertical collection with 3 cells is loaded. In the second cell, from the main UICollection, a one…
0
votes
1 answer

Adjusting UICollectionView Header height?

I am trying to adjust the height of my CollectionView Header based on the height of myView's height. for example I want to be able to type: func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout:…
0
votes
2 answers

UICollectionView Header title change

I have a UICollectionView with 4 custom UICollectionViewCells. In the header of the UICollectionView there's a UISegmentedControl. My goal is to change the header UILabel that plays the role of a title. Right now if the segmented control value had…
Dani
  • 3,427
  • 3
  • 28
  • 54
0
votes
1 answer

How can I make a collectionView header become hidden when a button is tapped?

I am trying to make a collectionView header become hidden when a button is tapped but I cant seem to access this property from inside of the IBAction function. button function var buttonPressed:Bool = true @IBAction func changeView(_ sender:…
0
votes
1 answer

How can i add an action button into a collectionView's section cell?

I have a photos collection view with different section header with different items but i want to add an action button into the last cell of a section which will take a photo and will be added the photo to the section cell and only last cell of the…
0
votes
0 answers

Dynamic height for UICollectionReusableView with UITextView + Image wrap

I have a quiz in which each question may or may not have an image, and an unknown length of question text. I am using a Collection View in which the question is in the header, and answers are in the cell. I want the header height to be dynamic to…
0
votes
1 answer

How to add a header supplementary cell above other supplementary header cells In a collectionView custom layout

So I have a custom layout collectionView that looks something like this: I did this with the help of @McDonal_11 with a custom layout [not a flowLayout] that basically allows my collectionView to display each section with it's items in a separate…
0
votes
1 answer

RxSwift Cannot convert call result type '(_) -> Disposable' to expected type '(_) ->

I'm trying to add an headerView to a collectionView using RxSwift. I get this error: Cannot convert call result type '() -> Disposable' to expected type '() -> at this line: obsHeader.asObservable().bind(to: collectionView.rx.items(dataSource:…
0
votes
1 answer

How to wrap UICollectionView section and items with a border (shadow)?

I want to make a border/shadow around each pair of section and items of my uicollectionview. Further I want to round the top corners of the section view and the bottom corners of the items in the last row. Do you know how to do this? - Is it…
0
votes
1 answer

UIButton not selectable when pressed and does not segue in custom UICollectionReusableView

When I press the edit button located in the Header View nothing happens, the button is just not selectable and I'm not sure why. The custom UICollectionReusableView with the edit UIButton and the button function. class headerView:…
Alex Cowley
  • 123
  • 4
  • 11
0
votes
1 answer

pass data from Collectionview to UIcollectionResuableview

I have a collectionView to which the data (String) is passed from another VC upon load. Now when I want to pass this data (String) to the UICollectionReusabelView. I am performing the following steps CollectionViewVC: class PhotoDetailVC:…
Aakash Dave
  • 866
  • 1
  • 15
  • 30
0
votes
1 answer

UIActivityIndicatorView disappears in CollectionView Footer

I have a collectionView with only 1 section in my app which download data from API. I have a pagination and I am trying to add a loading footer in my collectionView. The header appears normally. I have in this footer cell an UIActivityIndicatorView…
0
votes
1 answer

UIlabel Sizetofit unexpected behavious

I am facing an unexpected behavior with my UIlabel sizeToFit() method. Now I have tried making the numberOfLines = 0, I event called LayoutIfNeed(). But None of them works. I even tried methods given in this question : Vertically align text to top…
Aakash Dave
  • 866
  • 1
  • 15
  • 30
0
votes
1 answer

PerformSegue from UICollectionReusableView(Header) custom button Swift

I have a headerView in which I am having a float button. Since all the subitems in the float button are programmatically generated and it is a subview of headerView I am not able to call a performSegue. I tried creating a delegate method, But I…
Aakash Dave
  • 866
  • 1
  • 15
  • 30