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
8 views

Validate Texture Dimensions failed assertion `MTLTextureDescriptor`. How can fix it?

Problem I'm rendering data from API in UICollectionView, when I scrolling down the collection view, I am facing that bug. validateTextureDimensions:1078: failed assertion 'MTLTextureDescriptor has ...
0
votes
0answers
15 views

UICollectionViewDropDelegate breaks reordering cell mechanics in UICollectionView

I'm trying to implement two collectionViews with drag and drop cells between them. But i faced strange behaviour with reordering cells inside collectionView. Here is minimal code that replicate that ...
0
votes
0answers
25 views

UICollectionViewFlowLayout estimatedItemSize breaks constraints during rotation but itemSize is totally fine

I'd like to display a bunch of UICollection view cells with images and labels and adjust their widths according to width of the labels. I don't want to override sizeThatFits() neither to override ...
0
votes
0answers
29 views

how to change the width of my collection view item based on the label text size? [duplicate]

I am trying to make a scrollable segmented control like the image above. I am using collection view to make that scrollable segmented control. I want to make every item has different width, based on ...
0
votes
1answer
15 views

UICollectionView Location for Supplementary Header

I am looking to put a header on my collection view's sections. I have a collectionview embedded inside a tablebview. Using the section headers of the tableview puts the header too far from the content....
0
votes
0answers
9 views

subviews are animating when they shouldn't be animating

I have a view controller that has a collection view inside of it. It has logic for showing in a half sheet state and full sheet state. When I navigate from a half sheet state to a full sheet state ...
0
votes
0answers
18 views

Dynamic Height cell did not applied in CollectionViewCell

I am trying to build dynamic height cell in Swift. Actually I achieved that dynamic cell height but I have to add new prop string to cell then calculate its height and then sum two label's height ...
0
votes
1answer
43 views

UICollectionView Multiple Cells Selection Swift iOS

I have UICollectionView in my iOS app and I am using Swift. I want to make UI like below: I this UI when "Select" button is not selected (in first image) Tab bar is visible, but when "Select" button ...
1
vote
3answers
49 views

Swift sort dictionary by value as Array

Hello guys i have struct Datas() which contains field start with date. I have like 24 objects and i want to add it to collection and sort collection by time (.start field). I tried answers from stack, ...
0
votes
1answer
32 views

Horizontal direction UICollectionView with UIRefreshControl reloadData() not working

I need to implement horizontal UICollectionView. Sometimes, I need to update the data, So I decided to implement a refreshcontrol. I called reloadData() with refreshcontrol. It seems to be working, ...
0
votes
1answer
30 views

how to access child elements in a collection view?

i am making frames in collection view and i want to change the background color of frames whenever i select the frames but the problem is that i cannot access my frames from the collection view and ...
-2
votes
2answers
38 views

collectionView.indexPathsForSelectedItems.contains(x)

I am trying to run collectionView.selectItem(at: indexPath, animated: false, scrollPosition: []) if if(!collectionView.indexPathsForSelectedItems?.contains(x)) returns true. But I can't seem to get ...
0
votes
2answers
50 views

change tableview cell content on collection view cell selection

I have a tableView and collectionView in one view controller. in tableView I have title description and in collectionView I have lable . I want on collectionView label selection tableView content ...
3
votes
1answer
59 views

How to setup Horizontal UICollectionView with paging, but items per page arrange from left to right & top to bottom

I had complete setup Horizontal UICollectionView with paging, but currently items per page is arranged from top to bottom and left to right, Now I want that items arrange from left to right & top ...
-1
votes
1answer
52 views

Setting UIbutton image from a function from another class

So I have a list of songs, and when I click on the moreButton the SongDetailCell is presented and the setPlayPauseOnAppeaering() function is called on the selected song. This function will either set ...
-2
votes
0answers
53 views

I want to scroll from collectionview to the last cell [on hold]

I have set the collectionview to view. Each cell has uiimageview. However, collectionview can not scroll to the last cell. I can see the picture in the last cell, but I can not scroll. import UIKit ...
0
votes
2answers
25 views

Why UICollectionViewCell images are not loaded although the image var is not nil in debugger?

I am using a collection view to show choices for categories in a news app. My collection view images are not loaded in the cell. On checking in the debugger the image var contains the image. The ...
0
votes
1answer
20 views

drag and drop collectionViewCell in swift

whenever I drag and drop the cell in other section app gets crashed and when I drag and drop the cell in same section it works good any ideas how to fix it thank a lot in advance. below is the full ...
0
votes
0answers
35 views

How to fix 'Terminating app due to uncaught exception…' [duplicate]

I am building an app that uses a uiCollectionView but everytime I run the app I get the error, "Thread 1: signal SIGABRT" I have delt with this kind of error before, but this time I couldn't figure ...
0
votes
1answer
23 views

Dynamically handle the background and foreground colors inside UICollectionViewCell's elements

I have a UICollectionViewCell which contains a UIView enclosing a UILabel. I have to change the background color of UIView and the text color of UILabel on the base of a boolean value. The colors on ...
0
votes
2answers
52 views

collectionView numberOfItemsInSection in UITableviewCell

I made one collectionView inside the tableView cell I registered all delegates and protocols and in most cases everything works fine the problem is that the collectionView must dynamically generate ...
0
votes
1answer
34 views

Header view of UICollectionView keeps duplicating on scroll - How to create fixed (non-sticky), single collection view header?

I wanted to implement a view hierarchy like the following so that the ENTIRE view would be scrollable: UIScrollView Image View Collection view But a lot of people on here have said that it is ...
0
votes
0answers
31 views

How to properly manage memory while using child view controllers in UICollectionView cells?

I have UIViewController(HomeController) with horizontally scrollable UICollectionView in it. This collection view contains 2 cells (the number is not dynamic, there will be always only 2 cells). The ...
0
votes
1answer
15 views

How to load web view and image view conditional in collection view with in same section with flexible height

I am loading web view and image view on basis of condition. i am unable to manage height for collection view.
2
votes
2answers
72 views

How to reduce the amount of time between a tap on a cell and the running of certain code?

I have the below code which successfully causes a cell in a collectionView to depress when tapped. The issue is that one must hold for pretty long before the depression happens. Don't get me wrong. ...
1
vote
1answer
25 views

UICollectionView Horizontal align scroll first cell center alignment not exactly placing center position very first time using Swift

My scenario, I am trying to Implement UICollectionView horizontal scrollview first and last cell center alignment based on selection. Here, Very first time CollectionViewCell first cell not showing ...
1
vote
2answers
41 views

How to fix an image height inside UICollectionViewCell?

enter image description hereI have a UIImageView inside a UIView inside collection view cell but the image getting bigger in its height than its superview even if I did all the constraints (top, ...
1
vote
1answer
42 views

Constraint issue on UICollectionView

I have a collection view cell here where i places the labels... However when I put a new constraint on top of my Headline label, so that it doesnt run out of the cell it appears to be Anyone knows ...
1
vote
1answer
43 views

How to display the photolibray as a UICollectionView or as an Asset Grid on Swift

What's the best way to produce something similar to a Twitter upload page where about 10 photo library pictures are displayed for the user to select one? Below is the picture of what I'm trying to ...
0
votes
0answers
8 views

fetch coredata attribute and place it collectionview imageview

Any Place it says data I want to replace with Core Data Entity Jessica with attribute name (drawing). I want to fetch the the binary data and have the imageview (bg) which is in the collection view ...
0
votes
1answer
54 views

Recognize when the user touches down on UICollectionView cell

In the Facebook app they have a collection View at the top for stories. When a user taps on a cell there is a slight depression and then back, this begins happening before the user even lifts his ...
0
votes
1answer
30 views

Swift: Why my Buttons will be duplicated every time I scroll down and up?

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: ...
3
votes
0answers
26 views

UICollectionView inside of UICollectionView does not scroll

I have a UIViewController with a A UICollectionView inside it. Each cell of the A UICollectionView is a B UICollectionView. A UICollectionView has a vertical scroll. B UICollectionView has a ...
0
votes
2answers
38 views

How to match the horizontal collectionView Cell's width on it's content size

I know some related questions already there regarding this but I tried those before and still no luck. Here is my problem on the following screenshot My current screen shows a fixed cell size and ...
0
votes
2answers
67 views

How can I “freeze” a collectionView where it is?

I am trying to make it so that when the user swipes to reload in a collectionView it will "freeze"the cells where they are while I perform an animation. As in: when the reload happens they are 80px ...
1
vote
1answer
52 views

Is it possible to add a drag to reload horizontally for a collection view?

Update: I belive it may not be possible given the folowing line in apples documentation: When the user drags the top of the scrollable content area downward Found here. Let me know if there is a ...
0
votes
1answer
50 views

How to tap on item in one controller and have it show in a different uicollectionviewcontroller class

I'm trying to tap on a collection view cell in one collection view controller and have it dynamically added to another collection view controller on same screen that when filled will turn into ...
0
votes
2answers
54 views

UIRefreshControl endRefresh jumps when used with Large Title enabled

I'm trying to use UIRefreshControl, but when I call endRefreshing() it jumps the UINavigationBar. The problem only happens when I use UIRefreshControl along with large titles. Looking at some similar ...
0
votes
1answer
23 views

UICollectionView Layout Warnings

After formatting my main cells to do horizontal scrolling, I have been getting a warning that spams the entire console and just annoys me in general. I've already tried changing constraints and cell ...
1
vote
1answer
27 views

Issue in Showing Collection View in Table View Cell in iOS

i have a table view and i have placed a collection view inside the cell, i'm getting data from API and that data i'm passing to table view and collection view but when i run the app it crashes with ...
0
votes
1answer
52 views

Auto Adjustment of UIImageView

I am currently working on UIImageView and I have an API which returns a number of images, maximum =5 and minimum=1, I have to adjust the position of the image based on the response. Suppose I have ...
1
vote
4answers
223 views
+50

Why is text on a UICollectionViewCell disappearing when tapped on?

Update: So I tested something new, I added a label to the cell and then ran and when tapping that label does not disappear. I also checked and made sure it was not due to constraints. The only ...
0
votes
1answer
15 views

Recreating Instagram/Pinterest profile - How can I recreate the instagram/pinterest profile in swift?

Currently I am trying to recreate something like the Instagram/Pinterest iOS profile page where you can swipe between sections that have different data and layout while having a header that doesn't ...
0
votes
0answers
11 views

Force Header to be horizontal with horizontal scroll in UICollectionView

I am trying to create, what I thought was going to be an easy layout. I have a UICollectionViewController that has a bunch of cells in them. The scroll direction for the collection view is set to ...
0
votes
0answers
22 views

Swift UICollectionView Cell displayed/scrolled in to the view incorrectly when keyboard hiding animation change bottom inset

I am building a messanger view in iOs (Swift) app with help of UICollectionView inside a UIViewController. I am taking inspiration from MessageKit and I was able to set everything properly with simple ...
0
votes
0answers
41 views

How to load image with SDWebImage correctly in UICollectionView in swift

I'm facing the following problem, well I have a custom collection view, where I upload an image from the URL I get from a service, everything works fine at the moment but sometimes when scrolling or ...
2
votes
2answers
68 views

How to set collectionview cell to start at index '1' not '0' - Swift

I have two custom cell classes HomeCell & CreateCell. Ideally, the first cell should be the CreateCell & the HomeCell's should start at the index of '1' (After the first create cell) but ...
0
votes
1answer
30 views

Get thumbnails for Array of Videos

I have found a few ways to get a thumbnail for a video using AVAsset However I want to get the thumbnails for an array of videos. I am populating the array from the applications documents folder on ...
0
votes
2answers
43 views

Collection view cell zoom not resetting

I have a view controller with a collection view that looks like this: import UIKit private let reuseIdentifier = "LightboxCollectionViewCell" class LightboxViewController: UIViewController, ...
1
vote
1answer
33 views

CollectionView Cells not loading in View Controller

I'm trying to load in some data in a feed based off of a user's data through Firebase, however, it isn't working. My application is currently organized so that the user enters on ...