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

100 questions
1
vote
3 answers

Reusable data sources in Swift w/ different cell types

Based on this article I have created a reusable data source for UICollectionView as follows :- final class CollectionViewDataSource: NSObject, UICollectionViewDataSource { typealias CellConfigurator = (Model, UICollectionViewCell) -> Void …
1
vote
1 answer

Assign UIScrollView Delegate And UICollectionView Delegate to the Same Class

I have a paging UIScrollView, each page being populated with a different view controller. Above the scrollview is a UICollectionView that acts as a menu bar. As you scroll through the scrollview pages, the menu bar moves just a little bit. You can…
1
vote
1 answer

Push a new UICollectionViewController from a UICollectionViewCell that is inside of multiple UICollectionVIews

I really tried my best to find a solution to this problem. I tried different solutions with delegate and protocols but my code did not work. Before complaining about my question please support me and let us work as a community. Tell me if you don't…
1
vote
2 answers

How to scroll to a particular index in collection view in swift 4?

I have searched various links related to this question but unable to solve this issue that's why I am posting this question. I have a collectionView. In a particular cell I have many views like UserProfileView, ProductView, CommentBoxView etc. In…
1
vote
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…
1
vote
1 answer

Invalid Selector Using Delegate Pattern

I am attempting to use the delegate pattern to animate a change in height for a collectionView. The button that triggers this change is in the header. However when I press the button not only does the height not change but it also crashes with the…
Ron Baker
  • 351
  • 2
  • 13
1
vote
1 answer

Delegate Function Not Being Called

So I am trying to use protocols and delegates to connect two functions so I can perform some operation on a variable a collectionView in this case in a different file. import Foundation import UIKit protocol EventCollectionCellDelegate:…
Ron Baker
  • 351
  • 2
  • 13
1
vote
1 answer

How to access a variable stored in a CollectionViewCell in my CollectionViewController

Hi I've been having trouble accessing a String value that is stored inside of my CollectionViewCell to use in a segue in my CollectionViewController. My CollectionViewController comprises of an arbitrary number of cells that have a Button, a Label…
1
vote
1 answer

Delegate method indexpath not found

I have implemented this delegate method for UICollectionViewDelegateFlowLayout, but when attempting to dequeue the cell there, I get this error: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM…
steventnorris
  • 5,056
  • 20
  • 82
  • 156
1
vote
3 answers

UICollection is very slow in showing Image with Swift 3

I'm using UICollectionView to show the images in my app. The problem is that it takes very slow to show images. After 50 seconds, the images in collection view appears. :( When I find the solution in google, mostly they write the following codes.…
1
vote
2 answers

How to get header of collection view in swift?

How to get Header of collection view on DidSelectItemAtIndexPath for change text of header while select item.
1
vote
2 answers

Creating UICollectionView programmatically

I am learning how to create a UICollectionView programmatically. I want to create a grid of pictures collected from the user in another part of the app. Will this sample code help me accomplish this? Also, how do I configure the data to emit the…
Allie
  • 57
  • 7
1
vote
0 answers

UICollectionView in Keyboard extension does not work after connecting to delegate/datasource

I have made a custom keyboard extension using storyboard, and it works fine in the Simulator. I need to add emoji function to it. I have done this by adding a 2nd view on the storyboard and set it to hidden in viewDidLoad and you press a button on…
theMouse
  • 307
  • 4
  • 14
1
vote
1 answer

UICollectionView.reloadData() changes cell order | iOS Swift

So I am working with a simple UICollectionView, 3 columns by X rows, where X is set by the variable matchesFromSelectedSession.count + 1. Here are the delegate functions that I am using for my collectionView: func collectionView(collectionView:…
1
vote
1 answer

Why does UICollectionView conform to UICollectionViewDelegateFlowLayout by default?

I'm just confused with the following code that gets executed in a UICollectionViewController instantiated from a xib file: - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout…