UIPhotoGallery
UIPhotoGallery copied to clipboard
“Collection was mutated while being enumerated” on line for (UIPhotoContainerView *subView in reusableViews)
When I try to zoom in and out multiple times quickly on an image in fullscreen mode, the sample application crashes intermittently. it stops at line: "for (UIPhotoContainerView *subView in reusableViews) {" from "UIPhotoGalleryView.m"
breakpoint analyzer: #0 0x38dd9cc0 in objc_exception_throw () #1 0x2e4c99f0 in __NSFastEnumerationMutationHandler () #2 0x0009d61c in -[UIPhotoGalleryView scrollViewDidScroll:] at UIPhotoGallery/UIPhotoGalleryView.m:172 #3 0x311026e4 in -UIScrollView(UIScrollViewInternal) _notifyDidScroll
I seem to have fixed the issue by taking a copy of the array(reusableViews) Change line #169 in "UIPhotoGalleryView.m" to: for (UIPhotoContainerView *subView in [reusableViews copy]) {
Hi, thanks to your feedback & contribution. Please create a pull request, I'll merge it and update new version.
Thanks again