Tag: uicollectionviewcell

How to dynamically add labels and buttons in section header of UICollectionView?

Please help me how I can add labels horizontally and similarly buttons horizontally but each button should align at down of each label like a another section. This should happen dynamically in the header of the UICollectionView as the number of labels and buttons is according to my data. I want to make a excel […]

Loading UICollectionViewCell one at a time

As per this article http://aplus.rs/2014/how-to-animate-in-uicollectionview-items/ I am trying to load a UICollectionViewCell one at a time to animate the cell when it appears. However, when I call the code the loops the cellCount++, it produces this error: Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Invalid update: invalid number of items in section 0. The […]

In a UICollectionView how can I preload data outside of the cellForItemAtIndexPath to use within it?

Figured out slow loading images were the behind the choppy slow effect of my collectionView. I’ve been reading different Q&A’s all day and various forum posts. It looks like the best way to solve this issue is to have the data pre-loaded available for the cellForItemAtIndexPath to be able to take what it needs. I’m […]

ios – horizontally scrolling collectionView with images

I am trying to show images on collectionView. I have trouble showing this images as I have created a reusable cell with imageView inside.Those images have to be equally spaced between as I want to show 3 icons on screen at once. I am using 13 icons and it has to be scrollable horizontally through […]

UICollectionViewCell Only Updates After Scrolling

I’ve got an issue with my UICollectionView where my cells are always initiated blank/in a default state with no data. The data only appears in the cells after scrolling them in and out of view. Thoughts? Thanks. CODE: -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @”EquipmentCell”; APInventoryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath]; […]

Cell disappearing after scrolling 2 – 3 times in UICollectionView

I’m facing a strange issue while scrolling my UICollectionView. It’s showing a blank view without any cells in it. It strangely hides my cell or removes my cell, I don’t know, but I’m unable to find any solution. I have tried these solutions from SO: 1st : Tried to create custom class of UICollectionViewFlowLayout and […]

UICollectionViewCell gets hidden randomly

I have a UIView in which I am adding a collection view to act as a banner view to look like a carousel. The Viewcontroller in which UIView is present, is part of pageviewcontroller. PageVC –> UIViewController –> UIView –> UICollectionView. Each VC has its own banner, so when the page is swiped, I reload […]

How to insert images in uicollectionview programmatically?

I’m pretty new to Objective-C so hopefully this all makes sense..I ran code provided in first answer Creating a UICollectionView programmatically..It is working fine .Now i want to add some pictures in cell that can expanded by mouse click .I searched many tutorial but all using nib files or storyboard files .How i can accomplish […]

UItableviewCell Deselect all

I have a FollowVC and FollowCell Setup with collection View. I can display all the datas correctly into my uIcollection view cell using the following code with no problem. func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCellWithReuseIdentifier(“FollowCell”, forIndexPath: indexPath) as? FollowCell { let post = posts[indexPath.row] cell.configureCell(post, img: img) […]

UICollectionView crashes randomly because of highlighting issue

I have a UICollectionView on iOS7 which crashes randomly when intense scrolling. I enabled zombies and found that it gives me an error saying: *** -[NSIndexPath section]: message sent to deallocated instance 0x17dbc970 I believe this is due to an Apple error described here. Apparently, the app crashes when someone highlights a cell while scrolling […]