Compare commits

..
2 Commits
Author SHA1 Message Date
Alex.k fdea171402 Fixes #18 2016-06-08 16:22:41 +03:00
Alex.k 956a270b1e update podspec 2016-06-08 14:42:29 +03:00
4 changed files with 24 additions and 3 deletions
@@ -22,6 +22,7 @@ class DemoViewController: ExpandingViewController {
extension DemoViewController {
override func viewDidLoad() {
itemSize = CGSize(width: 256, height: 335)
super.viewDidLoad()
registerCell()
@@ -104,7 +105,8 @@ extension DemoViewController {
extension DemoViewController {
func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
override func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
super.collectionView(collectionView, willDisplayCell: cell, forItemAtIndexPath: indexPath)
guard let cell = cell as? DemoCollectionViewCell else { return }
let index = indexPath.row % items.count
@@ -188,7 +188,19 @@ extension BasePageCollectionCell {
frame.origin.x -= yOffset / 2
frame.size.width += yOffset
}
func configureCellViewConstraintsWithSize(size: CGSize) {
guard isOpened == false && frontContainerView.getConstraint(.Width)?.constant != size.width else { return }
[frontContainerView, backContainerView].forEach {
let constraintWidth = $0.getConstraint(.Width)
constraintWidth?.constant = size.width
let constraintHeight = $0.getConstraint(.Height)
constraintHeight?.constant = size.height
}
}
}
// MARK: NSCoding
@@ -107,6 +107,13 @@ extension ExpandingViewController {
extension ExpandingViewController: UICollectionViewDataSource, UICollectionViewDelegate {
public func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
guard case let cell as BasePageCollectionCell = cell else {
return
}
cell.configureCellViewConstraintsWithSize(itemSize)
}
public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
fatalError("need emplementation in subclass")
}
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'expanding-collection'
s.version = '0.2.0'
s.version = '0.2.1'
s.summary = 'Transition animtion from CollectionView to TableView'
s.license = 'MIT'
s.homepage = 'https://github.com/Ramotion/expanding-collection'