Removed un-necessary code.

This commit is contained in:
Khan, Arshad 2020-03-13 20:23:20 +05:30
parent 022f76b8b2
commit 9b8046009a

View File

@ -183,7 +183,7 @@ open class Carousel: View {
pagingView?.removeFromSuperview() pagingView?.removeFromSuperview()
guard let pagingView = view else { guard let pagingView = view else {
bottomPin?.isActive = false bottomPin?.isActive = false
bottomPin = safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: collectionView.bottomAnchor) bottomPin = bottomAnchor.constraint(equalTo: collectionView.bottomAnchor)
bottomPin?.isActive = true bottomPin?.isActive = true
return return
} }
@ -191,9 +191,9 @@ open class Carousel: View {
addSubview(pagingView) addSubview(pagingView)
pagingView.centerXAnchor.constraint(equalTo: collectionView.centerXAnchor).isActive = true pagingView.centerXAnchor.constraint(equalTo: collectionView.centerXAnchor).isActive = true
collectionView.bottomAnchor.constraint(equalTo: pagingView.bottomAnchor, constant: position).isActive = true collectionView.bottomAnchor.constraint(equalTo: pagingView.bottomAnchor, constant: position).isActive = true
safeAreaLayoutGuide.bottomAnchor.constraint(greaterThanOrEqualTo: pagingView.bottomAnchor).isActive = true bottomAnchor.constraint(greaterThanOrEqualTo: pagingView.bottomAnchor).isActive = true
bottomPin?.isActive = false bottomPin?.isActive = false
bottomPin = safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: collectionView.bottomAnchor) bottomPin = bottomAnchor.constraint(equalTo: collectionView.bottomAnchor)
bottomPin?.priority = .defaultLow bottomPin?.priority = .defaultLow
bottomPin?.isActive = true bottomPin?.isActive = true
@ -336,15 +336,13 @@ extension Carousel: UIScrollViewDelegate {
handleUserOnBufferCell() handleUserOnBufferCell()
} }
public func scrollViewDidScroll(_ scrollView: UIScrollView) { open func scrollViewDidScroll(_ scrollView: UIScrollView) {
// Check if the user is dragging the card even further past the next card. // Check if the user is dragging the card even further past the next card.
checkForDraggingOutOfBounds(scrollView) checkForDraggingOutOfBounds(scrollView)
// Let the pager know our progress if needed. // Let the pager know our progress if needed.
pagingView?.scrollViewDidScroll?(collectionView) pagingView?.scrollViewDidScroll?(collectionView)
collectionView.collectionViewLayout.invalidateLayout()
} }
public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {