so i'm panning cells in collection view. cells wiggling. i'm using following code re-order cells in dataset. works out. problem have panned cell stops wiggling. noticed happens when pan fast, throwing place. looked on internet. people advise using invalidatelayout(). unfortunately isn't helping. know help? tx.
code:
func panningmediainmediacollectionview(gesture: uipangesturerecognizer) { switch(gesture.state){ case .began: guard let selectedindexpath = self.mediacollectionview.indexpathforitematpoint(gesture.locationinview(self.mediacollectionview)) else {break} self.mediacollectionview.begininteractivemovementforitematindexpath(selectedindexpath) case .changed: self.mediacollectionview.updateinteractivemovementtargetposition(gesture.locationinview(self.mediacollectionview)) case .cancelled: self.mediacollectionview.cancelinteractivemovement() case .ended: self.mediacollectionview.endinteractivemovement() self.mediacollectionview.collectionviewlayout.invalidatelayout() default: self.mediacollectionview.cancelinteractivemovement() } }
it helpful see functions performing animations doing, can post functions? using core animation?
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
Comments
Post a Comment