I have 3 UIViews Header / Tabar / Container embedded un a ScrollView in a ViewController. So this is my structure :
In the ContainerView I load a UICollectionView (like this) :
let controller = storyboard!.instantiateViewControllerWithIdentifier("myCollectionViewController") as! myCollectionViewController
controller.delegate = self
self.addChildViewController(controller)
controller.view.backgroundColor = UIColor.brownColor()
self.containerView.addSubview(controller.view)
controller.didMoveToParentViewController(self)
Everything works perfectly, each cells of the UICollectionView are loaded,... The only problem is that, all the hidden cells (and even all the parts of cells that are hidden) are not selectable. What I mean is my function "didSelectRowAtIndexPath" doesn't work for every pixel out of the first screen. This is a scheme of my problem :
This is what I have before the scroll (on the left is a scheme, on the right is what I actually have on the screen) -> here everything works fine :
This is what I have after the scroll (on the left is a scheme, on the right is what I actually have on the screen) -> only the pixels that were displayed before the scroll can call "didSelectRowAtIndexPath" :
The problem reside in the fact self.view.frame is not refreshing well. Do you have an idea of how I should change this frame and when?