ios - UIView animation is clouding UICollectionView delegate - Swift -


is there known disfunction between uiview.animatewithduration , uicollectionview delegate?

i having issue uicollectionviewcells not clickable if animate uiimageview serves background of uiviewcontroller (delegate methods such shouldselectitematindexpath not called @ all)

but if comment out method call animating background, cells clickable, delegate methods called , works fine.

just mention, have custom uiview class , nib load onto viewcontroller (uicollectionview inside view).

this code:

override func viewwillappear(animated: bool) {     super.viewwillappear(animated)      customview = nsbundle.mainbundle().loadnibnamed("customview", owner: self, options: nil)[0] as! customview      customview.frame = childview.bounds     self.childview.addsubview(customview)     customview.initialize()      //self.rotateview()  }   func rotateview() {      uiview.animatewithduration(18, delay: 0, options: .curvelinear, animations: { () -> void in         self.backgroundimage1.transform = cgaffinetransformrotate(self.backgroundimage1.transform, cgfloat(m_pi_2))         }) { (finished) -> void in             self.rotateview()     } } 

this custom uiview's initialize() method:

func initialize(){     collectionview.backgroundcolor = uicolor.clearcolor()     collectionview.registernib(cellnib, forcellwithreuseidentifier: "cell")     self.collectionview.delegate = self     self.collectionview.datasource = self      ... } 

while performing animations, default, elements non-interactable. can enable sending .allowuserinteraction part of options.

try :

func rotateview() {     uiview.animatewithduration(18, delay: 0, options: [.curvelinear,.allowuserinteration], animations: { () -> void in         self.backgroundimage1.transform = cgaffinetransformrotate(self.backgroundimage1.transform, cgfloat(m_pi_2))         }) { (finished) -> void in             self.rotateview()     } } 

Comments