Comments (2)
Listen on UIScrollView delegate:
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
let center = self.view.convert(self.collectionView.center, to: self.collectionView)
guard let indexPath = collectionView.indexPathForItem(at: center) else {
return
}
print("current magnified cell index = \(indexPath.row)")
}
from fapaginationlayout.
If you would like to get notify while scrolling for magnify cell change, do as follow:
private var lastIndexPathForCenterItem = IndexPath(row: 0, section: 0)
func scrollViewDidScroll(_ scrollView: UIScrollView) {
callCenterChangedIfNeeded()
}
private func callCenterChangedIfNeeded() {
guard let indexPath = indexPathForCenterItem() else {
return
}
guard indexPath != lastIndexPathForCenterItem else {
return
}
lastIndexPathForCenterItem = indexPath
// Magnify center cell change, do stuff
}
private func indexPathForCenterItem() -> IndexPath? {
let center = self.view.convert(collectionView.center, to: exploreCollectionView)
return collectionView.indexPathForItem(at: center)
}
from fapaginationlayout.
Related Issues (10)
- Tap not detected HOT 7
- scrollToItem have some bugs
- Unable to find a specification for `FAPaginationLayout` HOT 1
- is there any same library like this one available for android? HOT 1
- Not working Swift 3.2 And Xcode 9.1
- Not Working on Vertical Scroll Direction
- Scroll by cells HOT 5
- Not working on right to left HOT 1
- how to change item spacing ???
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fapaginationlayout.