You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skeleton loading does't work if cells get register in code: collectionView.register(UINib.init(nibName: "\(Cell.self)", bundle: Bundle.main), forCellWithReuseIdentifier: "Cell")
What did you do
Created UIViewController in .xib file
Added UICollectionView in UIViewController as a subview
Added view and collectionView as skeletonable
Created UICollectionView cell in a separate .xib file
Linked cell to UICollectionView by collectionView.register(UINib.init(nibName: "\(Cell.self)", bundle: Bundle.main), forCellWithReuseIdentifier: "Cell")
added delegate and dataSource for UICollectionView as self (UIViewController)
start animating in viewDidLoad
implemented SkeletonCollectionViewDataSource
run app
I would expect it to identify the cell and add Skeleton loading to it but instead just the UICollectionView animates
Steps to reproduce the behavior
Create a UICollectionView in a UIViewController placed in a .xib file and not .storyboard.
Register UICollectionViewCell in code as presented above.
SkeletonView version:
1.1.1 Xcode version:
9.2 Swift version:
4
The text was updated successfully, but these errors were encountered:
looked a bit around the framework and it seems that in this case the cells in extension SkeletonCollectionDataSource: UICollectionViewDataSource get placed after func recursiveShowSkeleton gets called
so calling view.showAnimatedSkeleton() on the ViewController's view causes only the whole UICollectionView to animate (since there are no existing cells at that time)
I have created a fix for this in this pull request: #42
Skeleton loading does't work if cells get register in code:
collectionView.register(UINib.init(nibName: "\(Cell.self)", bundle: Bundle.main), forCellWithReuseIdentifier: "Cell")
What did you do
collectionView.register(UINib.init(nibName: "\(Cell.self)", bundle: Bundle.main), forCellWithReuseIdentifier: "Cell")
viewDidLoad
I would expect it to identify the cell and add Skeleton loading to it but instead just the UICollectionView animates
Steps to reproduce the behavior
Create a UICollectionView in a UIViewController placed in a .xib file and not .storyboard.
Register UICollectionViewCell in code as presented above.
SkeletonView version:
1.1.1
Xcode version:
9.2
Swift version:
4
The text was updated successfully, but these errors were encountered: