Questions tagged [uicollectionview]

The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts. Collection views provide the same general function as table views except that a collection view is able to support more than just single-column layouts. Collection views support customizable layouts that can be used to implement multi-column grids, tiled layouts, circular layouts, and many more. Available in iOS 6.0 and later

0
votes
0answers
4 views

How to put footer view at the bottom of collectionView?

I have collectionView, and I need to have a footer view at the bottom of collectionView. When I'm adding UICollectionReusableView it looks like as "current footer"(there is attached image). But I need ...
1
vote
0answers
27 views

Weird cell behavior in UICollectionView when displaying cell

I've been struggling with this issue for days and have no idea what's causing it. The collectionview loads the first set of cells properly, but for some reason, all following cells "fill in" to the ...
0
votes
2answers
19 views

Problem with set ordering property In UICollectionView

I have a strange problem with collectionView, I have two prototypes, first one should draw in indexPath.row=0 and the second one should be created four times. The second prototype contains one UIView ...
0
votes
2answers
27 views

Divide the number of cell between two prototypes

as I am beginner I have a problem that may not be so pro to ask. I have two prototype collection view cell in my app, let's call them Cell1 and Cell2, they both are in a same section. override func ...
2
votes
1answer
32 views

Taking the value on didSelectItemAt for indexPath and add it to a delegate / protocol to populate a header cell

Using protocol / delegate & retrieve the data from didSelectItemAt (collectionViews). // This class have the data // WhereDataIs: UICollectionViewController override func collectionView(_ ...
0
votes
0answers
21 views

How to show a decoration view below a particular item and update it when some event occurs

I am using a UICollectionView and I want to show a decorationView below a particular cell. Also when I receive an event from server regarding that Item I want to change the decorationView to next Item....
1
vote
0answers
14 views

How to expand an xib collectionviewcell height dynamically?

I am looking to make my xib custom collection view cell height dynamic when clicked upon rather than using a fixed variable height. I have tried using constraints on the heights of the cell in the ...
0
votes
1answer
49 views

UIScrollView not showing up in the view

I am implementing a UIScrollView in a CollectionViewCell. I have a custom view which the scroll view should display, hence I am performing the following program in the CollectionViewCell. I have ...
0
votes
0answers
17 views

Updating collection view (necessity of calling performBatchUpdates)?

I am attempting to insert (and later delete) items from a collection view, which sits inside a tableview. When inserting items into the collection view, I get the following error: *** Terminating ...
0
votes
1answer
21 views

CollectionView Cell subview on top of header

So, I have CollectionView that contains a header (used as a stretchy header) and underneath is just a cell containing a picture surrounded with red circles. Is there a way to bring the red circles ...
0
votes
1answer
20 views

iOS - Change UICollectionView layout to fill rows instead of columns

Is it possible to change the UICollectionView so that it fills the rows instead of the columns ? Here's an image explaining it : EDIT : It's an horizontal scroll EDIT 2 : I already fits 3 cells in a ...
0
votes
2answers
35 views

How to add sound feedback like pickerview in collectionview?

Hi I'm trying to add feedback when scrolling through the collectionview Items. Where should I add code for feedback in collectionview delegates. If I add in willDisplay then add cell that will be ...
0
votes
1answer
37 views

Nesting Multiple CollectionView

I am building a layout represented in the following way. The hierarchy is in the following way : view | |__CollectionView (CV1), vertical scroll |__ CV1.SimpleCell1 |__ CV1....
0
votes
0answers
38 views

Is it Normal to have CPU Usage 20-25% when scrolling a UICollectionView Containing a UITextView?

I am creating a Chat Message UICollectionView containing a UITextView. I calculate the cell size according to message Text. When I scroll collection View CPU Usage jumps to 20-25% when scrolling stop ...
0
votes
1answer
26 views

Autosize for cell in UICollectionViewCell

In my cell I have Title label and description label. Description label can be small and big. I use for it descriptionLabel.sizeToFit(), but how to use the same for cell. If cell.sizeToFit() doesn't ...
0
votes
2answers
54 views

Swift: Create stack of imageView with collectionView

Hey i want to create stack of UIImageView like the photo, how to do this It must be dynamic. How can I move the cells so that they are one below the other?
0
votes
1answer
32 views

Add Multiple UICollectionView in UIScrollView with Paging by using single ViewController

I would like to have a paging UIScrollView with five UICollectionView that each have different data. Is it possible with one ViewController?
1
vote
1answer
38 views

In iOS 12, when UICollectionView is created using Self Sizing cells with constraints, upon reload layout has wrong height until I scroll

I have a weird issue in iOS 12 when using solution as explained here. It works great when collection view loads for first time, however when I try to reload the collection view using either ...
0
votes
0answers
13 views

How to fix animate image inside collection view cell?

I have collection view and view for header and i make simple animation. When user start scrolling collection view, header height constrain changes size and animation on. But i have problem with my ...
0
votes
0answers
37 views

UICollectionViewCell Protocol is not working correct

I have a Protocol inside my CellClass which is detect the function 'editCommentInFeed'. I have create an 'editButton' inside my Cell and define the handler with 'editCommentField' which is calling per ...
0
votes
0answers
34 views

CollectionView cell autosizing to content

In my UICollectionView 1(CV1), I am trying to make the cell width according superview and height according to the the content of the cell. Inside CV1's cell, I have another UICollectionView(CV2) which ...
0
votes
1answer
43 views

UICollectionView glitches on scroll

I am implementing UICollectionView for loading all the contact information on the screen. Keeping the main and the background threads clean, I am loading the data on the collectionview. Now as soon as ...
0
votes
0answers
19 views

Why isn't my picture in Firebase showing on my collection view?

I'm trying to get a picture from a specific user from Firebase in my collection view. I wrote everything perfectly without errors. But it's not presenting on my collection view. The only thing I can ...
0
votes
0answers
13 views

Swift: Animating UIScrollView contentInset not working

I have a vertically scrolling collection view, and when the user scrolls it past a certain threshold I want the cells to animate downwards off the screen to reveal the background view (similar to ...
0
votes
1answer
19 views

Shifting Neighbouring Cells to Right in Collection View

In tvOS, I have a collection view which is horizontally scrolling. On focusing a cell in collection view I want the focused cell to increase its size and also want the neighbouring cells to slide ...
3
votes
2answers
32 views

Can't change animation duration for deselect anim

I try to implement custom animation for cells in UICollectionView cell, but I can't implement animation for deselecting action. I use swift and developing project for iOS >= 10 It is example project ...
0
votes
0answers
36 views

How to get UICollectionViewCell SuperView as UICollectionView

I am trying to get indexPath of a UICollectionViewCell inside CollectionViewCell class. I have created an extension for this, but it returning nil I tried this code extension UICollectionViewCell{ ...
0
votes
0answers
16 views

Call targetIndexPath while dragging in same UICollectionView

Is there a way to have collectionView(_:targetIndexPathForMoveFromItemAt:toProposedIndexPath:) called, while dragging dragging and dropping an item within a single UICollectionView – (not a ...
0
votes
0answers
20 views

UICollectionView - bouncing (scrolling past the end of the content) sometimes glitches and jumps back without animating

I've got a really strange bug in a UICollectionView. When I scroll past the content (with bouncing enabled) and let go, the collectionView jumps back to the end of the content. That's intended. ...
0
votes
0answers
67 views

UICollectionView reloads data without calling reloadData()

I have structured my app using the MVVM pattern, the datasource of the collectionView gets data from the viewModel. In viewModel I have a closure which gets called after updating the data, it passes ...
0
votes
3answers
31 views

Scroll To Item UICollectionView with UIButton programmatically

I'm having a moment of confusion and I can't solve a very simple thing. My CollectionView has 50 cells and I would like to scroll back and forth between the cells using a "Next" button and a "Back" ...
0
votes
1answer
32 views

Dowload image from Firebase

Please help me. Explain how to set the image in the cell. In my Database I have: title, description and imageURL (url from Firebase Storage). Can you write me a code and explain. class ...
0
votes
0answers
28 views

How to make self-sizing cells for dynamic UICollectionView?

I have UIScrollView with horizontal scrolling direction and dynamic height (user can change the height when finger moved). I need to make cells able to resize itself when UIScrollView change height (...
-2
votes
2answers
53 views

UICollectionView Not Scrolling Vertically

I'm new to ios development. Was creating a grid view with UICollectionView. View doesnt scroll vertically, but when i change the scroll direction to horizontal it does. I want it to scroll vertically
1
vote
2answers
34 views

CollectionViewCell is no displayed receiving data from Firebase

I have to fill the cells with data from the firebase. But they are not displayed. Help and explain where I made a mistake. How to fill cell data ? class TrainingProgramViewController: ...
0
votes
1answer
24 views

Titles in UICollectionView header aren't displaying correctly

I'm doing Movie app and titles (movies categories) aren't displaying correctly in UICollectionView Header. Instead of "Adventures", it shows "Cartoons" in all categories. What can be wrong in ...
0
votes
1answer
27 views

How do I prevent willDisplay cell: from being called when I reload a UICollectionView's data?

I have an animation being called on a cell (to shirk fast and grow slowly). The animation is being done in willDisplay cell:. The problem I have is that whenever I reload the data after fetching more ...
-1
votes
0answers
18 views

Honoring a collection view's sectionInset in a section header view

I have a collection view with many sections. The collection view uses a standard UICollectionViewFlowLayout. Each section has a header supplementary view (derived from UICollectionReusableView). Each ...
0
votes
1answer
20 views

Smooth Scrolling between Table/Collection View and the Scroll View

I am implementing a scroll view which consists of an image underneath it is a collection view. What I want to do is a smooth scrolling between the page as if the collection view is just elements in ...
0
votes
0answers
33 views

iOS: How to pass scroll through collection view to another collection view behind it

I have a problem with setting up with two CollectionView. My case: On the top of the screen, I have CollectionView (A) with recommended products (which is CollectionView with simple imageview). On top ...
0
votes
1answer
40 views

Is there a way to load only a few items from a large list of objects and populate into a UICollectionView

I have a List containing 100 objects, but i want to load only the first 10 and populate it into my UICollectionView and when i scroll down i can then populate the remaining objects into the list. ...
0
votes
1answer
41 views

Loading Aync Gifs to Scrolling CollectionView

The gifs I fetch from the Giphy API returns correctly and in fact loads properly to the uicollectionview using SwiftGif. The issue only surfaces when I scroll immediately, the uicollectionview loads ...
0
votes
0answers
23 views

How to add page control inside second collection view swift

I have a problem with adding a page control to second collection view. I'm trying to create something like this Collection view for the main page -> inside collection view there's a second ...
-1
votes
2answers
51 views

How I will show multiple video's , images? When I am uploading multiple images and vieos

I am trying to use UICollectionView to show multiple images like my Screenshot.Can anyone suggest me how I will manage this design. Like This
-6
votes
1answer
54 views

How to Add Business Logic in CollectionView? [closed]

Business Logic Is :- If items are even, then display them 2 in each row. If items are odd, display the first one to span the full row, and show the remaining spanning 2 in each row.
0
votes
2answers
33 views

UICollectionViewCell Protocol is not working

I have a Protocol inside my CellClass which is detect the function 'editCommentInFeed'. I have create an 'editButton' inside my Cell and define the handler with 'editCommentField' which is calling per ...
0
votes
1answer
25 views

Access a CollectionView's layout properties in Layout object

I have implemented a subclass of UICollectionViewFlowLayout, which only overrides one method func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity ...
0
votes
1answer
37 views

I am Trying to Create an Expandable Table View With Child Element Having a UICollection View

I am Trying to Create a Table View which is Expandable It's Childview has a UICollectionView UICollectionView is Dynamically rendered using API onTouch Event of UICollectionView Item should be taken ...
0
votes
3answers
78 views

UICollectionView cell spacing for both portrait and landscape

My goal is to make equal spacing between the cells for the portrait and landscape orientation. I am able to do it for the portrait orientation but not for the landscape orientation. I wanted to close ...
0
votes
1answer
39 views

UICollectionView BackgroundView Issue

I am trying to add a custom, interactive view behind a UICollectionView (represented by the yellow background in the picture). The easiest way I've found to do this is by using the backgroundView ...