SkeletonView
SkeletonView copied to clipboard
The Nested Collection view becomes unresponsive in iOS 14 when using SkeletonView.
I am using SkeletonView version 1.8 and it was working fine in iOS 13(Xcode 11.7). When I run this to iOS 14 with Xcode 12 the nested collection views have become unresponsive after calling
self.showAnimatedGradientSkeleton(usingGradient: gradient, animation: animation, transition: .crossDissolve(0.25)) Method.
I have a similar issue. Using SkeletonView 1.8.7 makes a collection view within a collection view cell (therefore nested) unresponsive (no horizontal scrolling or taps recognized), although the SkeletonView is used in a different view controller in a different tab. 🤷♀️
Ok, we need to investigate deeper
The only thing I meanwhile discovered was that the call to swizzleLayoutSubviews()
disables the user interaction in my cell...without it, as far as I can see now, everything in our setup still works. Animated as well as non-animated.
After some more investigation and considering reworking my views I discovered that I was adding the nested collectionView
to the cell view instead of the contentView
of the cell, which is not supposed to work at all, but does until the swizzled layoutSubviews
of SkeletonView changes something. Sorry for the fuzz... :)
I am seeing the same happening on my setup. Two CollectionViews nested. The outer CollectionView is not supposed to animate, but the inner is.
After some more investigation and considering reworking my views I discovered that I was adding the nested
collectionView
to the cell view instead of thecontentView
of the cell, which is not supposed to work at all, but does until the swizzledlayoutSubviews
of SkeletonView changes something. Sorry for the fuzz... :)
Same here!
So in your UICollectionViewCell instead of self.addSubview(someOtherView) [or addSubview(someOtherView)] you should do contentView.addSubview(someOtherView).
This StackOverflow post https://stackoverflow.com/questions/63947042/since-updating-to-xcode-12-i-am-not-able-to-place-any-uicontrol-inside-uitablevi highlights this.
Super useful! Thank you all for your comments, solved here too ✅
After some more investigation and considering reworking my views I discovered that I was adding the nested
collectionView
to the cell view instead of thecontentView
of the cell, which is not supposed to work at all, but does until the swizzledlayoutSubviews
of SkeletonView changes something. Sorry for the fuzz... :)
I spent at least 6 hours trying to figure it out why my collection view wasnt working after calling showSkeleton() and im sure that i would spend a lot more until realize about contentView in my cell... dude you just saved my life i was totally going crazy here, you solved my problem THANK YOU YOUNG MASTER OF COLLECTION VIEWS
@joaopedro96 I am glad my error was of service to you. 🙂 Your's truly, dudette and mistress of collection views.