Questions tagged [uicollectionviewdelegate]

In iOS versions 6.0 and above, The UICollectionViewDelegate protocol defines optional methods that allow you to manage the selection and highlighting of items in a collection view and to perform actions on those items.

The UICollectionViewDelegate protocol defines methods that allow you to manage the selection and highlighting of items in a collection view and to perform actions on those items. The methods of this protocol are all optional.

Conforms to: UIScrollViewDelegate Framework: /System/Library/Frameworks/UIKit.framework Availability: Available in iOS 6.0 and later. Declared in: UICollectionView.h

Source: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewDelegate_protocol/Reference/Reference.html

108 questions
4
votes
1 answer

Difference between UICollectionViewDelegateFlowLayout UICollectionViewFlowLayout

I know that UICollectionViewDelegateFlowLayout is a protocol while UICollectionViewFlowLayout is a class, and I know the difference between a protocol and a class. From my understanding, I can have a class to follow the…
3
votes
1 answer

Potential Bug in UICollectionview in iOS14

I am encountering a strange behaviour in the way iOS14 handles a CollectionView. I have noticed that (changing from iOS13.5 to iOS14) the order in which the UICollectionViewCells are displayed is wrong. The pictures below are screenshot from…
3
votes
1 answer

UICollectionViewCell reuse causing incorrect UISwitch state

I am having trouble finding a solution for this issue. I am using UISwitch inside UICollectionViewCell and I am passing a boolean variable to set switch on or off. The condition is only one switch has to be ON at a time from all cells. But When I…
3
votes
2 answers

iOS Swift CollectionView delegate not getting called

I have conformed the protocols UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIScrollViewDelegate to a seperate class named CollectionViewWeekDelegate but the delegate methods such as didSelectItemAt is not getting called. I'm also…
Akshay Sood
  • 6,366
  • 10
  • 36
  • 59
3
votes
2 answers

CollectionView nested inside Collectionview

I have seen solutions where a collection view is nested inside a table view but for my app I need to have 2 collection views as it makes it easier to do some other things. So lets call the root collection view VerticalCollectionView which only…
3
votes
1 answer

Why insetForSectionAt UICollectionView delegate not calling in iOS Swift 3?

I have problem with UICollectionView Delegation. Because insetForSectionAt delegate never call. So see this code and help me to fix this : import UIKit class GalleryCollectionViewController: UICollectionViewController { var…
3
votes
3 answers

tvos UICollectionView lose focus to previous Focus Cell

I am building a tvos application. i have a strange bug where UICollectionView lose focus of the previously selected cell when i navigate back to that particular view. The scenario is some thing this like this. I have two UIViewControllers A and B.…
Madu
  • 4,849
  • 9
  • 44
  • 78
3
votes
0 answers

Serious bug for UICollectionViewFlowLayout: minimumInteritemSpacing and minimumLineSpacing in horizontal scrolling mode

I am facing the following bug with UICollectionView in the horizontal scrolling mode (iOS 8, iOS 7, the only ones I have tested). My question I would like to have your views on this bug and on how I could elegantly solve it. The setting…
3
votes
4 answers

UICollectionView: Do I need to use an UICollectionViewController?

I am using XCode5 and iOS7. Is it possible to embed a UICollectionView into a normal UIViewController class and have the UIViewController implement the methods? Or do I need the UICollectionViewController? Which methods are required at minimum?
mrd
  • 4,561
  • 10
  • 54
  • 92
2
votes
1 answer

Pros/cons of implementing a particular set of delegate methods versus not implementing them and the effects of implementing one but not another?

In regards to UITableView & UICollectionView & their respective protocols, UITableViewDataSource & UITableViewDelegate + UICollectionViewDelegate & UICollectionViewDataSource -- are there any pros and cons to implementing one method, but not the…
2
votes
1 answer

cellForItemAt function not getting called at UICollectionViewController in Swift 4

It seems pretty basic but I can't make it work in Swift 4. So I have the following implementation of UICollectionViewController class TestController: UICollectionViewController, UICollectionViewDelegateFlowLayout { override func viewDidLoad()…
JaviOverflow
  • 1,434
  • 2
  • 14
  • 31
2
votes
2 answers

How to set focus on collectionView in swift 4?

Hello I have a UICollectionView. In a particular cell I have many views like UserProfileView, ProductView, CommentBoxView etc. In CommentBoxView there is a text view where the user can type and then post the comment. After posting the comment I want…
2
votes
0 answers

How do I create a horizontal UICollectionViewLayout like this

I am wondering how do we make a UICollectionViewLayout like this? It seems to be a difficult thing to achieve. I am able to create a horizontal layout but I am unable to make the second cell onwards become small and stack on each other like the…
2
votes
0 answers

Is it possible to intercept delegate method call in UICollectionView subclass?

I am implementing a single row carousel view by subclassing UICollectionView and UICollectionFlowLayout. The visual looks similar to the following: I want to only enable touch on the middle cell and disable the rest. Currently, I put the…
crab oz
  • 635
  • 7
  • 16
2
votes
0 answers

"GetSizeForItem" for a UICollectionView in Xamarin with UICollectionViewFlowLayout does not get called

I have a UIViewController that has a UICollectionView added as a subview in the viewDidLoad. I am using a UICollectionViewFlowLayout and have created a custom MvxCollectionViewSource to manage the cells. I provide the cell information in the…
B K
  • 1,554
  • 3
  • 19
  • 40