Compare commits

...
2 Commits
Author SHA1 Message Date
Alex.k 656aa95fea Fixes #12 2016-06-06 16:30:37 +03:00
Alex.k 0f00fde7e6 update podspec 2016-06-06 09:38:56 +03:00
2 changed files with 8 additions and 3 deletions
@@ -17,8 +17,13 @@ public class ExpandingViewController: UIViewController {
public var currentIndex: Int {
guard let collectionView = self.collectionView else { return 0 }
let startOffset = (collectionView.bounds.size.width - itemSize.width) / 2
return Int((collectionView.contentOffset.x + startOffset) / (itemSize.width + 25))
let startOffset = (collectionView.bounds.size.width - itemSize.width) / 2
guard let collectionLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout else {
return 0
}
let minimumLineSpacing = collectionLayout.minimumLineSpacing
return Int((collectionView.contentOffset.x + startOffset + itemSize.width / 2) / (itemSize.width + minimumLineSpacing))
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'expanding-collection'
s.version = '0.0.4'
s.version = '0.0.5'
s.summary = 'Transition animtion from CollectionView to TableView'
s.license = 'MIT'
s.homepage = 'https://github.com/Ramotion/expanding-collection'