0

I have implemented this UI model:

tableview that have for all rows one collectionview

I have a problem. When i scroll the tableview the scroll isn't smoothly. The profiling tool told me that the time gas been allocated for the collectionview reuse inside tableview cell. Any solution? I am going crazy :(

refs to: Independent scrolling for each section of a UICollectionView?

Community
  • 1
  • 1
Andrea Bozza
  • 1,374
  • 2
  • 12
  • 31
  • This UI configuration sounds wrong – Levi Oct 30 '14 at 22:02
  • I have used this in the past. You'll need to show some more code for us to determine what might be happening though. Can you share some code please. Preferably how you are populating the tableviewcells with the collection view and also how you are populating the collection view cells. – Fogmeister Oct 30 '14 at 22:13

1 Answers1

0

I have found with time profiler that:

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

        let cell = collectionView.dequeueReusableCellWithReuseIdentifier(collectionCell, forIndexPath: indexPath) as ItemCollectionCell

        var ash = showcaseArray.objectAtIndex(indexPath.section) as? Showcase
        var idcat = ash?.id
        var catalogs = self.showcaseElements.objectForKey(idcat!) as [Catalog]
        var aCatalog: Catalog = catalogs[indexPath.row] as Catalog
        var test = aCatalog.title  
        cell.catalogTitle = test

When i access to an NSObject of kind Catalog too much time are spent for this assignement:

    cell.catalogTitle = test

I cannot understand.

The NSObject is:

class Catalog: NSObject {
   var contentId = ""
   var type = ""
   var title = ""
   var sequence = ""
}
Andrea Bozza
  • 1,374
  • 2
  • 12
  • 31