Is it possible to write a concise code for the case below

I have an app which has two tabs. In the first BookVC tab, I use UICollectionViewController to show books and in didSelectItemAtIndexPath i call a function that push the BookDetailVC. And in Bookmark tab, i want to show all books which was bookmarked

The Swift UICollection cell sets the height for each other line

I'm trying to create a table with two columns where even rows are taller than the odd rows. This is what I currently have. import UIKit class FBSCollectionViewCell: UICollectionViewCell { @IBOutlet weak var cellText: UILabel! } class ViewController:

UICollectionViewCell Loses Value When Refreshing Swift 3

The first image shows that whenever I click a cell on the collectionview it will show the ID of the selected cell on the title view of the View Controller: Now my problem is, whenever I sort the title of the collection view, and click a single cell t

Pass the indexPath between collections

I am trying to pass indexPath of the cell that user taps so when the segue performs collectionView scrolls to the correct cell. But I am stuck and I don't know what i am doing wrong. Here is my code: FIRST VIEW CONTROLLER var selectedRow = 0 func col

UICollectionView in UITableViewCell, UITableView Dynamic Height

I have a UITableViewController with each UITableViewCell containing a UICollectionView where contents of UICollectionView should be fully visible. My problem is that when returning height of UITableViewCell I cannot return the correct height because

Can not get a cell subview?

When user choose a cell , I would like to get one of its specific UIViews and change its color. So, func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { for cell in collectionView.visibleCells() as

The image in the cell does not appear

I'm using alamofire to get url image from json file, and want to display the image I get from json to imageview in cell. I'm new to swift and swift networking. My code on MainCollectionViewController: private let reuseIdentifier = "Cell" class M

Spacing in CollectionView cells

How to remove spacing in collectionview cells. I want to get 18 rows and 22 columns which should fit according to frame height and width. I override the UICollectionViewFlowLayout but there is a space after last column in collection view. Can some on

CollectionView inside ViewController

I know there are already questions out there but I don't understand them or I just do not know what I am doing. So I am getting this error when I try to run my app Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forI

cellForItemAtIndexPath is not called, we do not know why

I've read a few other questions on this that the problem related to the size of the CollectionView. I've tried adjusting the size as recommended in those answers, but none of them were working. I'm using a NSFetchedResultsController which convolutes

How to have a tag list and below other items

I want to have something like this: And below it some text, images, and other stuff.So basically I need a UIScrollView as the root view of my View. I thought to add a UICollectionView to add the tags because I dont want to manage adding constraints b

UICollectionView only reloads the first cell

I have a collectionView in my app and i want to reload only first cell of collection view. How can i reload only first cell of UICollectionView?You can use reloadItemsAtIndexPaths:, method of UICollectionView to reload the first cell. The index path

UICollectionView custom animation

I use a UICollectionView with UICollectionViewFlowLayout. I change the height of a UICollectionViewCell if a user touches it. To achieve that I use performBatchUpdates:to animate the height change. This works perfectly and the change gets animated wi

UICollectionViewController reloads images on scroll

I am using the ParseFramework to get some images and display them in a collectionViewController. The thing is, if I scroll before all images are loaded, I experience duplication of images, so I find the same image in different cells. Here's the code

UICollectionView does not display any image

I'm trying to display image from documents directory in UICollectionView, everything works fine, but no image appears - (void)viewDidLoad { [super viewDidLoad]; // Initialize recipe image array NSArray *paths = NSSearchPathForDirectoriesInDomains(NSD

negative or nil sizes are not supported in flow layout

I got a rather complicated collectionView cell and I've noticed that if I scroll really fast on my collectionView it crashes the app. One of the error I got is this: negative or zero sizes are not supported in the flow layout I noticed if I just retu

Springboard animation for removing UICollectionViewCells

I am trying to figure out a way to animate the deletion of a UICollectionViewCell similarly to springboard in iOS 7. The deleted cell should shrink into nothingness and the remaining cells should slide over to fill its place (the sliding is the impor

Creating a multi-column view on iOS

I just got a design handed to me for implementation. At the moment this view should list elements vertically in two columns (I imagine that this would translate to more columns on the upcoming design for iPad), all of which with a maximum width equal

How to display the ALAsset video at UICollectionview ios

I tried below code to get all videos from photo library by using ALAsset. For now, i want to display all videos to a UICollectionview but it doesn't seem to display anything. Please give me some advice. Thanks in advance. -ViewDidLoad() : get all vid

Memory warning received in UICollectionView iOS 7

I am using UICollectionView to show all the images available in my library using assets, its displaying all the images but when I scroll up and down many times , I receive a memory issue in the device and after some time it gets crashed saying CRASHE

Custom Collection Show cells displaying the wrong image

I have about 80 images in my bundle resources. As part of my Category Class I have a property called Image Name which hold the name of the image that I need to load into the image view. I use [UIImage imageNamed:Category.imageName]. This loads the co

UICollectionView and other views in a view controller

I have a iOS app with a rootViewController. In this view controller there are many different views. now i want a collection view in this view. how should I do this? What I have tried is. Added a uicollection view to the storyboard and set the datasou

UICollectionView does not display cell images

I have a viewcontroller and uicollectionview in it. I used following code, but there is no visible images in uicollectionview, just yellow boxes : myviewcontroller.h { IBOutlet UICollectionView *gallery1; //IBOutlet UIImage *inimage; NSArray *recipeP

Definition of .reuseIdentifier on a UICollectionViewCell

I have a particular UICollectionViewCell that I want to instantiate myself, and add to a UICollectionView. In order for this to work, the UICollectionViewCell instance needs its .reuseIdentifier property to be set. Normally, the class or Nib that des