Sunday, 15 June 2014

ios - UICollectionView hitTest -> normal behavior -



ios - UICollectionView hitTest -> normal behavior -

i overrode hittest, , works fine. want behave if hadn't overridden method under conditions, , that's problem lies.

i'm using subclassed uicollectionview render cells on mkmapview using custom uicollectionviewlayout implementation. needed override hittest in uicollectionview subclass touch events can passed mapview , can scrolled. works fine.

i have toggle mechanism animates between uicollectionviewlayout (map) uicollectionviewflowlayout (animate items on map grid format). works too, when i'm showing flow layout, want user able scroll uicollectionview normal 1 (act though hittest isn't overridden). can't figure out homecoming in hittest have it's default behavior.

-(uiview*)hittest:(cgpoint)point withevent:(uievent *)event{ if(self.tapthrough == yes){ nsarray *indexpaths = [self indexpathsforvisibleitems]; for(nsindexpath *indexpath in indexpaths){ uicollectionviewcell *cell = [self cellforitematindexpath:indexpath]; if(cgrectcontainspoint(cell.frame, point)){ homecoming cell; } } homecoming nil; } else { homecoming ??? } }

i've tried returning number of things. self, self.superview, etc... nil behave (i cannot scroll cells , down).

if want normal behaviour of nail test:

return [super hittest:point withevent:event];

this homecoming nail test returns when not overridden.

ios uiview uicollectionview uicollectionviewlayout hittest

No comments:

Post a Comment