We are using your awesome lib with UICollectionView for quite a while and everything was just perfect before we decided to migrate to UICollectionViewCompositionalLayout. Specifically, we have one section that has orthogonalScrollingBehavior set to .continuous.
What type of issue is this? (place an x in one of the [ ])
[ x ] bug
[ ] enhancement (feature request)
[ ] question
[ ] documentation related
[ ] discussion
Requirements (place an x in each of the [ ])
[ x ] I've read and understood the Contributing guidelines and have done my best effort to follow them.
Please replace this with the steps to reproduce the behavior.
Use UICollectionView with UICollectionViewCompositionalLayout and orthogonalScrollingBehavior.
Set isSkeletonable for collection view and section items to true.
Expected result:
Section with orthogonalScrollingBehavior is skeletoned.
Actual result:
Section with orthogonalScrollingBehavior is not skeletoned.
Attachments:
Investigation results:
It seems that for orthogonalScrollingBehavior system wraps items in _UICollectionViewOrthogonalScrollerEmbeddedScrollView, which obviously is not reachable directly and breaks isSkeletonable chain.
Possible workaround:
I came up with the workaround, that is probably a bit too hacky for a PR. So I decided to open the issue instead.
extension UIScrollView {
var isOrthogonalScrollView: Bool {
let isInCollectionView = superview as? UICollectionView != nil
return isInCollectionView && subviews.contains { $0.isSkeletonable }
}
override public var isSkeletonable: Bool {
get {
super.isSkeletonable || isOrthogonalScrollView
}
set {
super.isSkeletonable = newValue
}
}
}
Description
Hey!
We are using your awesome lib with UICollectionView for quite a while and everything was just perfect before we decided to migrate to UICollectionViewCompositionalLayout. Specifically, we have one section that has
orthogonalScrollingBehavior
set to.continuous
.What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
SkeletonView Environment:
SkeletonView version: 1.29.3 Xcode version: 13.4.1 Swift version: 5
Steps to reproduce:
Please replace this with the steps to reproduce the behavior.
UICollectionView
withUICollectionViewCompositionalLayout
andorthogonalScrollingBehavior
.isSkeletonable
for collection view and section items totrue
.Expected result:
Section with
orthogonalScrollingBehavior
is skeletoned.Actual result:
Section with
orthogonalScrollingBehavior
is not skeletoned.Attachments:
Investigation results: It seems that for
orthogonalScrollingBehavior
system wraps items in_UICollectionViewOrthogonalScrollerEmbeddedScrollView
, which obviously is not reachable directly and breaksisSkeletonable
chain.Possible workaround: I came up with the workaround, that is probably a bit too hacky for a PR. So I decided to open the issue instead.