SkeletonView icon indicating copy to clipboard operation
SkeletonView copied to clipboard

The Nested Collection view becomes unresponsive in iOS 14 when using SkeletonView.

Open Manikandan271192 opened this issue 4 years ago • 9 comments

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.

Manikandan271192 avatar Sep 17 '20 11:09 Manikandan271192

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. 🤷‍♀️

helkarli avatar Sep 17 '20 13:09 helkarli

Ok, we need to investigate deeper

Juanpe avatar Sep 17 '20 18:09 Juanpe

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.

helkarli avatar Sep 23 '20 13:09 helkarli

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... :)

helkarli avatar Sep 24 '20 13:09 helkarli

I am seeing the same happening on my setup. Two CollectionViews nested. The outer CollectionView is not supposed to animate, but the inner is.

RuiAAPeres avatar Jan 14 '21 15:01 RuiAAPeres

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... :)

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.

tsangaris avatar Apr 09 '21 20:04 tsangaris

Super useful! Thank you all for your comments, solved here too ✅

jowinst avatar Apr 15 '22 10:04 jowinst

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... :)

68747470733a2f2f6d65646961312e67697068792e636f6d2f6d656469612f765839576343695777554637472f3230302e676966

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 avatar May 30 '22 14:05 joaopedro96

@joaopedro96 I am glad my error was of service to you. 🙂 Your's truly, dudette and mistress of collection views.

helkarli avatar May 30 '22 14:05 helkarli