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
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
  • 317
  • 5
  • 15
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…
1
vote
3 answers

How do I pass a value to a custom UICollectionViewCell?

I have a custom UICollectionViewCell that I am attempting to pass a value to from my view controller. I'm able to pass an image to the cell, but anything else comes up nil upon initialization. Relevant code in the View Controller: override func…
1
vote
0 answers

UICollectionView headerReferenceSize set in delegate not working properly

I'm trying to use the headerReferenceSize in my custom UICollectionViewFlowLayout. I have set the collectionView:layout:referenceSizeForHeaderInSection: method in the collectionView delegate: func collectionView(collectionView: UICollectionView,…
Tometoyou
  • 7,792
  • 12
  • 62
  • 108
1
vote
2 answers

Custom Collection View

I have implemented the custom collection view using storyboard. and added a cross button and background image. When collection view reloading that cross button have been hide for admin and shown for other members which is work perfectly first…
Chandan Kumar Jha
  • 325
  • 2
  • 4
  • 18
1
vote
1 answer

Why are UICollectionViewDelegate and UICollectionViewDataSource separate protocols?

I'm trying to implement a separate class for UICollectionViewDelegate and UICollectionViewDataSource. However, I always seem to need access to the data model in order to calculate certain Delegate methods such as size of a cell. I've never seen…
quark
  • 1,725
  • 1
  • 14
  • 23
1
vote
1 answer

UICollectionView and writing text on cells

I create a multi-column table using UICollectionView. It works well as shown in the first picture. I created as each row represents different sections, i.e. the first row is section 0, the second row is section 1, etc. I need to write text for each…
1
vote
1 answer

Images are changing in collectionView when i scroll it

n the code below, the collectionView will scroll smoothly, but sometimes if I scroll extremely fast, there will be an incorrect image that shows and then changes to the correct one as the scrolling decelerates. Why isn't setting the Below is the…
1
vote
1 answer

SWIFT: Insert Section / Rows into UICollectionView by clicking a UIButton

I am trying to setup an UIButton that click it would add a new section into my UICollectionView. I've searched for some examples online, but could make them work. Following is one of the answers which looks fine, but still not working for me. Am I…
1
vote
2 answers

How to prevent collectionView:didSelectItemAtIndexPath delegate method called more than once

When i tap one of UICollectionView's cell more than once-double tap, triple tap-, it's delegate method didSelectItemAtIndexPath also get called more than once. What can be the slickest way to prevent it? I would appreciate any comments.
1
vote
5 answers

collectionView:didSelectItemAtIndexPath does not get called on tap

I have a UICollectionViewController and this collection’s cells have a subview -let’s say A- with same frame as cell bounds. The problem is when i tap on these cells, collectionView:didSelectItemAtIndexPath does not get called. I also set A’s…
1
vote
1 answer

UICollectionView doesn't scroll full 320 points with paging enabled

Alright so lets say I have UICollection with 20 cells That scrolls horizontally with paging enabled and can fit 9 cells on each page, when I make it 10 cells instead of creating a second page it moves just enough to fit the 10th cell on the page. I…
1
vote
1 answer

Compiler says I'm not conforming to UICollectionViewDelegate; conflicts with Actual Use

I believe I'm following the UICollectionViewDataSource, but the compiler says otherwise. What am I missing? import Foundation import UIKit class InviteFriendsViewController:UIViewController, UICollectionViewDataSource, UICollectionViewDelegate…
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
1
vote
1 answer

How to embed UICollectionView inside UICollectionViewSectionHeader

My app is crashing because of [UICollectionViewFlowLayout collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance. This is because my delegate methods are inside my UICollectionReusableView which is not a view controller.…