Uicollectionview not reloading swift Aug 11, 2017 · ok so the problem was that i wasn't reloading the data after i fetched images from firebase. But that part does not work as expected. Jun 25, 2016 · Swift 5, Programmatic UICollectionView setting Cell width and height // MARK: MyViewController final class MyViewController: UIViewController Dec 16, 2022 · You have the following line: if let room = data["roomNameLabel"] as? String, let roomDescription = data["roomNameDescription"] as? String, let dateRoomCreated = data Jan 5, 2016 · Also, Are you reloading the UITableView in viewWillAppear i. collectionView performBatchUpdates:^{ NSArray *selectedItemsIndexPaths = [self. The second section (section ==1) is where I want the section with the horizontal scroll. NewsManager. By selecting a row in tableview, I am able to change preview image and all labels. The only reason you don't see this for 0-3 is that you are not reloading the other collection view. Add collectionViewLayout in main thread before reloading collectionView which helps to adjust content size. Asking for help, clarification, or responding to other answers. func registerCell(collectionView: UICollectionView) { collectionView. Currently, I can change the color of the collection view's background, but can't add any The CollectionView is populated by passing the array into the tableview cell, which is a UICollectionView Delegate and DataSource. e Is the table data being refreshed when the B is popped and A appears? If Yes, then lastFocusedIndexPath will be nil on reload. UICollectionView reloading not properly. How to refresh collectionView. At any point of time the header will not go invisible even if all the cells under it are collapsed/hidden. reloadData() } 4 UICollectionview scrollToItemAtIndexPath,在动画完成之前不会加载可见单元格; 6 UICollectionView在滚动之前无法完全加载; 10 generateCGImagesAsynchronously何时完全完成? 10 检测UITableViewCell何时加载完成; 3 子视图何时完全、正确地布局? 3 Swift: UICollectionView 图片加载 Jun 7, 2017 · Trying to add a cell to my ViewController, and I'm having trouble. reloadData() in one of my functions. After clicks on OK button, the item in Collection View will delete. So I did reloading FooterView by calling self. Modified 6 years, CollectionView reload data not working swift ios? 0. Mar 26, 2018 · I would like to add a checkmark to a selected cell. Currently, images will be displayed when the user signs out and then signs back in. Dec 3, 2018 · It seems currentUser is nil when you are reloading the table for the first time, therefore it's not set on your cells and your updateUI is not even called. its just the index and both collection view will get selected. I have two solution for it. They’re the basic building blocks for many apps Jun 1, 2018 · Second UICollectionView not reloading. indexPath(feedCell) self. The reusing of "baseball cell" "football cell" is ok for me. If you’re not familiar with UICollectionView, I’d suggest to get familiar with this class immediately. loadMoreData() } It is unclear exactly how your code works since you have not shown us your loadMoreData() function. I also try to implement in DispatchQueue. invalidateLayout() And for some reasons something is not working. 3 - IOS 14 - xCode 12. To solve In certain conditions, on tvOS, a collection view will reset its focus on reloadData(). Now I am currently able to add all the videos into an array; and it prints out the correct count of Sep 28, 2018 · this part doesn't exactly says which collection view to select. save the fetched data in an array object 3. layoutIfNeeded() dispatch_async(dispatch_get_main_queue()) { -> Void in // Put the code you want to execute when reloadData is complete in here } Jan 17, 2019 · I am using UICollectionView in my project, but it does not draw the cells for the reused ones. If you could add the following in ViewDidLoad() uicollectionview not showing cells swift. UICollectionView reloadData() does not update cells in the Oct 29, 2017 · I am having my users press a button in the cell and this removes the data from the firebase backend. Then i change the number of cells to 30 and reload CollectionView, then draw method is called only 10 times. So the reloading would be like: Reloading content var has Uncommitted Updates : Bool A Boolean value that indicates whether the collection view contains drop placeholders or is reordering its items as part of handling a drop. How do I achieve this using Swift? The data I'm using is from a model with the values segued from the previous view controller. the usual scrollToItem is not working anymore in IOS 14 for me, and it was working in IOS 13. Second UICollectionView not reloading. May 23, 2018 · By this answer I came to know that if UICollectionViewCell is not visible then it will return nil. UICollectionView reloadData() does not update cells in the Jan 11, 2017 · EDIT: After doing some research it seems that the issue is coming from the fact that I need to remove the data from the CollectionView before reloading. In my ViewController I have four subviews, i. Anatomy of the UICollectionView class. The issue instead is just reloading data into the uicollectionview. Ideally I would only refresh the header and not the rest of the cells but there doesn't seem to be a way to do that. Today we are going to walk through a basic implementation of UICollectionView from scratch. QoSClass. I've tried to reload the collection view into the main t Nov 10, 2017 · Initially I fetch only 100 messages. If anyone can get rid of that flash that is caused with my current code then I will select their answer as correct! Apr 15, 2017 · I would recommend creating a custom class of UICollectionView and all the feed fetching calls should be made in custom UICollectionView class. I have tried, when i do the pull, i can see the subview showing the progress gif image. reloadData() self. Maintain a flag say didPush. I have been using this code to reload my UICollectionView: self. – Sulthan Commented Dec 3, 2018 at 19:53 Jan 27, 2017 · This works with swift 5. 2. reloadData() because it reduced cell swapping when records were inserted. UICollectionView Refresh Issue. At first of loading, speed is good. The way you are populating your cells May 18, 2017 · I am having a problem reloading the collection view so that it will display the images immediately after a post. height; Mar 16, 2015 · I'm face a strange problem, when I execute from an action (button) the reloadData of my UICollectionView the cells are not displayed correctly, only the background image of the cells are ok. I've got a TableViewController that is firstly parsing a local JSON file and rendering it's very simple Apr 3, 2015 · I've tried everything I can think of, including solutions in this thread: UICollectionView reloadData not functioning properly in iOS 7. It should be updated when either current item is changed (to scroll to the current item and highlight it), or the source data was updated (it can add/remove one item). Here is my Jun 10, 2016 · The collection view methods assume that your data source contains the currently correct data. fetch data 2. Not only have new APIs been introduced, but the fundamental concepts and conventions used to build collection views have shifted to embrace a series of modern programming trends — such as declarative UI development, composition, and strong Sep 14, 2016 · Add this piece of code after reloading the collection view: swift. when user click one button the particular cell should be reload and the UIView will be displayed in that cell only other cell not displayed. setContentOffset(CGPoint. Also to keep it simple ,like not nesting UICollectionViews,you can use : Main UICollectionView for Paging and add UITableview inside cell of UICollectionView. e UITableView, UICollectionView, View with UILabels, and View that displays preview image for that item. If the cell is then deselected (and thus another is selected), I would like to remove the checkmark. Here are two images showing what the screen looks like when it is first loaded and after the friends navigation button is clicked Jul 20, 2017 · If this is the case then your issue must be far greater then collection view not reloading. We solved it by not reloading the contents when B is popped. The structure of the three classes is below. The concept is simple, we first identify the desired data source snapshot item, update it, and then apply the changes to the data source snapshot. Hot Network Questions Oct 29, 2017 · I am having my users press a button in the cell and this removes the data from the firebase backend. but when I rotate the device, the cells don't get updated. Even am facing the same issue. Oct 4, 2013 · Updates - After further investigation it looks like this has nothing to do with subclassing the uicollectionview. One work around I came up with, I clear data source before making any changes, and call reloadData and finally update data source with all changes and call reloadData again :) Clearing and reloading ensures collection view will not messes it up with deleting Mar 10, 2015 · When the application is tested in an iPhone simulator, the first touch to the cells call didSelectItemAtIndexPath(). The issue I am having is the UICollectionView does not respond or update when using the UISearchBar. Now I am currently able to add all the videos into an array; and it prints out the correct count of Oct 25, 2017 · I want to reload only single cell after user select the contact (method didSelect contact). i just needed to put collectionView. Create a new Cocoa Touch Class file (File > New > File > iOS > Cocoa Touch Class). May 28, 2016 · If i put View Controller that has UICollectionView as a first page of UITabBarController then my list with cells (UICollectionView) is loading normally like this: But if i put it as a second View Controller when i open the tab it is like UIImageView and UILabel are disappearing from the cells: EDIT(Solution): ok so the problem was that i wasn't reloading the data after i fetched images from firebase. – Mar 28, 2017 · When the number changes the layout and size of each cell should be changed accordingly. 4, and any help would be greatly appreciated Just to give a bit more information, the method I'm using to delete a cell is looking a little like: self. reloadData did not quite work. Oct 16, 2014 · I have many cells with differ identity value. If you replace those views, the animations are lost. invalidateLayout() in dispatch after 1 second in viewWillAppear but still not getting the result as FooterView expanded. Provide details and share your research! But avoid …. layoutIfNeeded() dispatch_async(dispatch_get_main_queue()) { -> Void in // Put the code you want to execute when reloadData is complete in here } Mar 7, 2017 · ios swift UICollectionVIew Issue: The behavior of the UICollectionViewFlowLayout is not defined because Hot Network Questions Unix shell scripting help- how to replace file delimiter if exist inside double quotes data of a delimited csv file? The solution given by Shaunti Fondrisi is nearly perfect. standard. 2 (one week ago). It can be just a Single View App. 7 with swift 5. 8. deselectItem(at: $0, animated: false) }) //this function will make it so only one cell can be selected at a 原文 2017-09-15 03:23:42 3 1 ios/ swift/ uicollectionview/ uicollectionviewcell Question I have been trying to implement a collection view in which a user can like a post but for some reason when a user does do that it updates the feed but simply doubles the number of cells and leaves the old cells which should be gone. Thanks a lot ! – Tom3652 Jun 11, 2015 · I want to create a lazy loading method for a messaging View using "willDisplayCell" - the user should be scrolling upwards, messages get fetched and prepended func collectionView(collectionView: Oct 4, 2013 · Updates - After further investigation it looks like this has nothing to do with subclassing the uicollectionview. Feb 11, 2022 · I'm working with a UICollectionView as UIViewRepresentable. First, look at the finished project. May 23, 2017 · Its Late to answer, At viewDidAppear you can get it by: float height = self. i just need to to put collectionView. Call collectionView. This subview adds new cells to the collectionview. May 20, 2017 · I add UICollectionView in my app and each cell has "Delete" trash button. Here is a Swift 3 version to performBatchUpdates without animation to a UICollectionView. async { self. Oct 14, 2016 · Some things I tried: disabling animation, running different things on different threads, reloading the rows one by one, reloading current row one way and the rest a different way, bunch of other stuff I don't remember lol. Think that i have 20 cells when the app open, draw method is called 20 times. If there has been some data changed, cellForItemAt does not get called. Greetings, I have a ViewController with a UITableView, which in turn has a few rows with a single UITableViewCell for each row, which in turn has a… Reloads just the items at the specified index paths. register(CellSkeleton. Jan 13, 2020 · Swift - display UICollectionView after retrieving data. yourCollectionView. Sounds like you’re trying to do too much by embedding a collection view in a tableview. Thanks in advance. Hot Network Questions I am building a layout in which i have to show airplane seats (grid layout) so i have used collectionView inside tableView, but the problem is that once data is fetched and passed to the vc and the tableview reloads, some of the rows with the collectionview appears to be blank/white boxes. How to maintain the scrolling speed after reloading the UICollectionView so user doesn't feel jerk? Jun 8, 2017 · Reloading collection view inside a table view cell happens after all cells in table view have been loaded; UICollectionView not updating inside UITableViewCell; I called the @IBOutlet weak var collectionView: UICollectionView! from UITableViewCell to UITableViewController at cellForRowAt. How do I fix this? Thank you. I think most of your issues would disappear if you moved all of your current stuff into a single collection view. This causes the collection view to discard any cells associated with those items and redisplay them. async { code } and it still take some time to load. deselectItem(at: [= 10 =], animated: false) }) //this function will make it so only one cell can be selected at a time //don't add this if you want multiple cells to be I used UICollectionView (flowlayout) to build a simple layout. reload() // Reload the data with fresh data collectionView. isEmpty == true || cache. swift Sep 15, 2017 · I have been trying to implement a collection view in which a user can like a post but for some reason when a user does do that it updates the feed but simply doubles the number of cells and leaves Feb 1, 2021 · Photo by kevin laminto on Unsplash. Reloading TableView from CollectionViewCell. GetProduct is causing it. Below is the smallest amount of code that reproduces the problem. Thus, though I managed to assign all the properties to my UICollectionViewCell class that I get from the server, once I run the project the data will not appear on cells unless I scroll my UITableView. Each header will have a hide/show button which will hide/show the cells. I’d suggest that you use Instrument to benchmark and find cpu spikes when you reload the page. but list doesnt do that, when using lists, swift automatically calculates only a few of the list's components which are needed to show the current Sep 6, 2020 · During the past two years, in iOS 13 and 14, Apple have made a number of significant changes to UICollectionView and the various types that surround it. But can't get it to work. then I stumbled on this SO answer. Ask Question Asked 5 years, 1 month ago. Create a new project. Thanks for the suggestions! Jun 10, 2016 · The collection view methods assume that your data source contains the currently correct data. The current selected is not. The top image view is independent from the Jan 25, 2019 · The jittering animation occurs because of this collectionView. If you add new items to the cache, you should not recalculate the existing elements. Any ideas are more than welcome. But when go to another page and go back to UICollectionView page, loading consume more time. func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool { collectionView. instead I would recommend this:. Ask Question Asked 6 years, Reload data in a UICollectionView - Swift. 2, XCode 6. Reloading the whole section works fine. I don't know if that is actually causing your issues or not, but I would start by dropping that Grid class. . Apr 24, 2013 · UICollectionView will animate and automatically rearrange the cells after deletion. An array of NSIndexPath objects identifying the items you want to update. Sep 11, 2015 · This is on Swift 1. Tried disabling UIView animation before, and enabling after reloading section, but still gives me a little animation. collectionViewContentSize. main. Commented Sep 15, 2015 at 9:34. If you have ever worked with table view, it will be very familiar to Feb 4, 2020 · If your UICollectionView have not proper content size, then cellForItemAt will not called. 2 Sep 16, 2017 · I invoke a full screen subview from one of my uicollectionviewcells. I try to select the images once again, and the previous images are viewed. Thanks for the suggestions! Jan 22, 2021 · Each cell loaded two button. layoutIfneeded() before reloading collectionView. reloadSections(IndexSet(integer: 0)) Sep 28, 2019 · I would like to change my entier array used to created all my cells with a button and then reload my collection view, but it is not working. When the user changes the number of cells this code is executed: myCollectionView. collectionView reloadData] and UICollectionViewDataSource protocol methods will be called. I'm wondering if I have all my delegates. DashBoardCollectionVC Sep 15, 2015 · can you please write that in swift – John Durand. Set this flag to true when B is pushed. It is being removed from the firebase database However it would NOT call. Instead of that, you just reload only that part which is necessary when action occurs. when you create a scrollview, it always calculates whole the ScrollView, then shows it to us. register(CellContact. performBatchUpdates({ let indexPathCellToDelete = self. Oct 23, 2021 · In general, you would use the UICollectionView as provided by UIKit, and then have your UIViewController subclass (for example, can be any other class) as a data source and delegate of the collection. Swift – Hacking with Swift forums. Even with NSFetchedResultsController you will run into this kind of issues quite frequently. Call this method to selectively reload only the specified items. tableView. Please share if you can come up with a better solution. However, the UI does not refresh , the item was not deleted. If the number of item in cell getting bigger, the process is getting slower. I was guessing that but that shouldnt stop the reloadData from reloading the collectionView though (cellForRowAtIndexPath does not get called in the code on the top) – user172902 Commented Sep 12, 2016 at 12:11 Sep 5, 2018 · Reloading the entire collectionView is not a solution either as it’s inefficient and results in screen blinking :/ Swift: UICollectionView invalidateLayout not Sep 29, 2019 · Also, most of the documentation refers to the UITablwView and it requires a bit of digging to find the correct names/method signatures for the UICollectionView. the width for each cell is set to the width of screen using self. What fixed the problem was calling reloadData from the main thread. I want the cell to be removed at the same time. 2. Here are two images showing what the screen looks like when it is first loaded and after the friends navigation button is clicked Oct 30, 2015 · 2015-10-30 14:00:39. Each section has a HeaderView (of type UICollectionReusableView) and multiple cells (of type UICollectionViewCell). Mar 15, 2017 · I'm working on a project in swift 3 and it contains a UICollectionView inside a UITableView. I found this to work better for me than collectionView. but the "AD cell" has some animation Feb 21, 2021 · A couple of months ago, I have wrote an article about “The Modern Ways to Reload Your Table and Collection View Cells“. Ask Question Asked 6 years, 3 months ago. set(1, forKey: "EnabledID") } else { if Reload data in a UICollectionView - Swift. Sep 28, 2017 · i am trying to implement a pull to refresh on a UiCollectionView using swift view. default). Sep 27, 2018 · @AndreaAbbate The first section (section == 0) is a section I am using for a custom header, so I don't need any sections returned for it. Thanks for the suggestions! Oct 3, 2018 · I have created a UICollectionView containing data from an API, which displays titles and poster images. Here is the code: func collectionView (_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool { collectionView. func collectionView(_ collectionView: UICollectionView This project has been tested with Xcode 10 and Swift 4. Mar 7, 2017 · ios swift UICollectionVIew Issue: The behavior of the UICollectionViewFlowLayout is not defined because Hot Network Questions Unix shell scripting help- how to replace file delimiter if exist inside double quotes data of a delimited csv file? The solution given by Shaunti Fondrisi is nearly perfect. This is not the best way as I can see we can load specific sections. Apr 17, 2018 · Learn how to use UICollectionView, with highly reusable UIKit components and some MVVM pattern without the going nuts with index path calculations. When I click on this button, it will show alert message to ask. such as "baseball cell" "football cell"and "AD cell". zero, animated: true) Objective-C UICollectionView Aug 6, 2017 · UICollectionview is loaded with simple cells and there is a simple int variable for calculating the number of items in the section. If i use reloadData(), whole collectionView gets reloaded. CollectionView not reloading after retrieving data from Firestore. When I make changes to the array inside the TableViewController, and call self. 1. width. Here is the code: Feb 15, 2017 · Here's high level description of what I'm trying to achieve; 1. UICollectionView reloadData() does not update cells in the collection view. The UICollection works fine showing both correctly. 0. Here is my code Reload data in a UICollectionView - Swift. collectionView. UICollectionView contains several key components, as you can see below: Take a look at these components one-by-one: UICollectionView: The main view where the content is displayed, similar to a UITableView. self, forCellWithReuseIdentifier: CellContact. However I can not refresh the UICollectionView data. collectionView?. This header view is a subclass of UICollectionReusableView. 893 test[6451:90574] the behavior of the UICollectionViewFlowLayout is not defined because: 2015-10-30 14:00:39. I have. Its work fine when picking the images, but the images is not appears on the UICollectionView. But gives me an unwanted animation. uicollectionview?. Before I remove this subview itself from its superview (uicollectionview) I call update function from the subview itself in uicollectionviewcontroller as below, func update() { self. func collectionView(_ collectionView: UICollectionView, Jun 20, 2018 · Why scrollToItem isn't working in my CollectionView? I want to work scrollToItem on EnabledID. My Code is May 7, 2025 · I have achieved it by reloading the entire collection view in viewWillTransitionToSize and changing the number of "maximum permissible items in section" in number of sections in UICollectionView. frame. My " culprit here. import SwiftUI @main struct DemosApp_tvOS: Feb 1, 2016 · If you'd like to perform some code after your collectionView has completed it's reloadData() method, then try this (Swift): self. collectionView. Delete selected items from collection view [self. I also added a reload method to the viewdidAppear method just to see the issue get even worse. Ensure these methods are called, ensure these are on the view controller (not a view), ensure these are on correct view controller, ensure these are plain view controllers and a custom implementation of embedded view controller. We faced the same issue. 893 test[6451:90574] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values. The code is as same as guard let collectionView = collectionView else {return} This is not a proper way to prepare layouts. So what's a problem and how fixed it? Code: var dataArray = NSMutableArray() // dataArray is has a data from Database var EnabledID = Int() EnabledID = UserDefaults. update collection view with the size of the array Here's my code class Sep 14, 2019 · I am not able to update the data of the Header View of a CollectionView. reloadItems(at: [IndexPath]) line written inside cellForItemAt which is really wrong approach because cellForItemAt called many a times leads to infinite loop of reloading IndexPath's. It's part of UICollectionView's delegate. let monsters: Monsters Apr 9, 2019 · CollectionView reload data not working swift ios? 0. class MessagesViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate { @IBOutlet weak var collectionView: UICollectionView! Jan 30, 2019 · UICollectionView not reloading data. integer(forKey: "EnabledID") if EnabledID == 0 { EnabledID = 1 UserDefaults. If it does not, the collection view might receive the wrong set of items from your data source or ask for items that are not there and crash your app. reloadData() in the functions where i fetch data. May 3, 2017 · I currently have a custom UICollection which loads a users video library from their camera roll. Mar 18, 2014 · -setCollectionViewLayout: or -setCollectionViewLayout:animated: won't cause your UICollectionView reload its data. Jun 28, 2019 · LIST VS SCROLLVIEW: as some of you may not know, list works a little bit different from a scroll view. UICollectionView does not reload properly. self, forCellWithReuseIdentifier: CellSkeleton. Jun 9, 2014 · I'm attempting to learn Swift & the basics of iOS dev at the same time, so bear with me. Jul 14, 2020 · The view will not display any collection until one of the navigation buttons are selected or the page is refreshed using the swift refreshControl. You just need to register both cells at once. view. indexPathsForSelectedItems?. reuseIdentifier) } Apr 28, 2017 · I have a UICollectionView with multiple sections. Nov 23, 2016 · I'm trying to pick multiple images from the library, and view at the UICollectionView. Smooth reloading thanks to Mar 19, 2021 · I'd suggest that you don't use reloadData() for what you're trying to achieve. Jan 1, 2015 · The UICollectionView's datasource and delegate methods are not being called. In order to keep the animation(s) running you would need to keep your views that are being animated in the view hierarchy. isEmpty == false, you do not actually check anything about the cached elements. To be sure, I just clicked on one of the two subclassed views. global(qos: DispatchQoS. reuseIdentifier) collectionView. myCollectionView. Collection view not reloading after retrieving data. reloadData() Aug 25, 2018 · Swift - display UICollectionView after retrieving data. com Jun 30, 2019 · My best guess is that the ProductService. But such a piece of code or codes like enqueue the execution of UICollectionView's reloadData() to NSOperationQueue's mainQueue indeed puts the execution timing to the beginning of the next event loop in the run loop, which could make the UICollectionView update with a flick. deleteItemsAtIndexPaths([indexPathCellToDelete Feb 3, 2021 · Anatomy of a UICollectionView. As the user scrolls, I fetch some more messages and then reload the collection view. When I am performing ReloadData and switching between the segments, in the first go (when I am taping on the segments the first time), the filter is working and all data is coming, but when I tap back on the segments, part of the content in the cell, especially the LabelViews text are not showing up afterwards. reloadData() } Mar 1, 2024 · Core animation applies animations to the CALayers that back the views you are animating. I am trying to implement a UISearchBar that searches based on the title. Add the code. but it is not entering the selector method loadData() or reloading the data. Mar 17, 2015 · Reload data in a UICollectionView - Swift. See similar questions with these tags. collectionView indexPathsForSelectedItems]; // Delete the items from the data source. forEach({ collectionView. viewWillAppear(animated) myViewModel. reloadData() myCollectionView. Like a table view, a collection view is a UIScrollView subclass. May 14, 2017 · The problem is that you are not reloading the collection view at all. I created shopping cart using UICollectionView. See full list on swiftsenpai. Oct 26, 2020 · I want to reload just footerView. My code for reloading the data (for testing purposes) is in viewWillAppear override func viewWillAppear(animated: Bool) { super. Jul 22, 2021 · Data only able to load at the first call and when try to fetch another call, collectionView do not update and keep refresh the first data that get from earlier API calls; Here's my class that manage networking. func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize Because this is not part of UICollectionView 's dataSource. Here i attached the collectionview image: Here my code: @IBOutlet weak var dataCollectionView: UICollectionView! Dec 9, 2016 · Swift 3: DispatchQueue. EDIT: Code in TableViewController: Dec 5, 2019 · In the case above cache. If you want to change your cell style or update the data, call [self. Jul 20, 2017 · If this is the case then your issue must be far greater then collection view not reloading. but the 4th index has to reload (when you scroll to see it) and it will get selected. But after reloading the collection view with reloadData(), only some of the cells call the didSelectItemAtIndexPath() and the touch is not registered with all of them. reloadData(), the CollectionView inside the cell does NOT update. reloadData would certainly kill your animation. To maintain the scroll position I set the content offset but scrolling gets stopped. collectionViewLayout. Nov 4, 2015 · Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Mar 17, 2015 · Is there something wrong with the way I am dequeuing the cell? You forgot to reload UICollectionView. I tried to call a method for reloading this data in different places but none of them is triggering the update. heesgjxushfbxmkxzceqccfubfryorgushrbwetgzvycsv