Fixes for crash issue in carousel
This commit is contained in:
parent
707f256a39
commit
d3e02c3bd0
@ -79,7 +79,6 @@ open class Carousel: View {
|
|||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.layoutCollection()
|
self.layoutCollection()
|
||||||
}
|
}
|
||||||
collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Invalidates the layout and ensures we are paged to the correct cell.
|
/// Invalidates the layout and ensures we are paged to the correct cell.
|
||||||
@ -211,9 +210,8 @@ open class Carousel: View {
|
|||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
currentIndex = 0
|
|
||||||
pageIndex = 0
|
|
||||||
pagingView?.reset()
|
pagingView?.reset()
|
||||||
|
collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
var pagingMoleculeName: String?
|
var pagingMoleculeName: String?
|
||||||
@ -225,7 +223,7 @@ open class Carousel: View {
|
|||||||
molecule.moleculeName == pagingMoleculeName {
|
molecule.moleculeName == pagingMoleculeName {
|
||||||
pagingView?.set(with: molecule, delegateObject, nil)
|
pagingView?.set(with: molecule, delegateObject, nil)
|
||||||
pagingView?.numberOfPages = numberOfPages
|
pagingView?.numberOfPages = numberOfPages
|
||||||
pagingView?.currentIndex = currentIndex
|
//pagingView?.currentIndex = currentIndex
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,7 +432,6 @@ extension Carousel: UICollectionViewDelegate {
|
|||||||
}
|
}
|
||||||
model.selectedIndex = adjustedIndex
|
model.selectedIndex = adjustedIndex
|
||||||
currentIndex = adjustedIndex
|
currentIndex = adjustedIndex
|
||||||
pageIndex = currentIndex
|
|
||||||
pagingView?.currentIndex = adjustedIndex
|
pagingView?.currentIndex = adjustedIndex
|
||||||
updateModelIndex()
|
updateModelIndex()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user