uiscrollview - Tap is not detected on continuous scrolling of UICollectionView iOS? -


i have uicollectionview continuous scrolling using nstimer, here code

let timer = nstimer(timeinterval: 0.1, target: self, selector: #selector(homeviewcontroller.scrolltonextcard), userinfo: nil, repeats: true) nsrunloop.currentrunloop().addtimer(timer!, formode: nsdefaultrunloopmode)  func scrolltonextcard(){     uiview.animatewithduration(0.1, delay: 0.0, options: uiviewanimationoptions.curveeaseinout, animations: {                 // changing contentoffset of collectionview continuous scrolling         }, completion: {(finished:bool) in      }) 

when tapping on of visible cells when scrolling in progress, delegate's method didselectitematindexpath not being called. how achieve tapping detection @ same time maintaining scrolling of collection view. please thanks

i found answer same, had add allowuserinteraction flag on animation block in code:

func scrolltonextcard(){    uiview.animatewithduration(constants.cardflowtimeinterval, delay: 0.0, options: [.curveeaseinout,.allowuserinteraction], animations: {         }, completion: {(finished:bool) in    }) } 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -