Compare commits

..
4 Commits
Author SHA1 Message Date
Alex.k b832f9e372 Fixes #17 2016-06-08 14:40:44 +03:00
Alex aa66607cbd Merge pull request #15 from Dershowitz011/master
Readme fixed again.. -_-
2016-06-07 13:38:40 +00:00
Alex.k 2ef07885b7 update podspec 2016-06-07 16:31:37 +03:00
Shantanu R Desai c91a711dd8 Readme fixed again.. -_- 2016-06-07 17:51:18 +05:30
4 changed files with 30 additions and 7 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ github "Ramotion/expanding-collection"
## Usage
```swift
import expanding_collection
import ExpandingCollection
```
#### Create CollectionViewCell
@@ -101,17 +101,20 @@ extension BasePageCollectionCell {
public func cellIsOpen(isOpen: Bool, animated: Bool = true) {
if isOpen == isOpened { return }
frontConstraintY.constant = isOpen == true ? -bounds.size.height / 5 : 0
backConstraintY.constant = isOpen == true ? bounds.size.height / 5 - yOffset / 2 : 0
frontConstraintY.constant = isOpen == true ? -frontContainerView.bounds.size.height / 5 : 0
backConstraintY.constant = isOpen == true ? frontContainerView.bounds.size.height / 5 - yOffset / 2 : 0
if let widthConstant = backContainerView.getConstraint(.Width) {
widthConstant.constant = isOpen == true ? contentView.bounds.size.width + yOffset : contentView.bounds.size.width
widthConstant.constant = isOpen == true ? frontContainerView.bounds.size.width + yOffset : frontContainerView.bounds.size.width
}
if let heightConstant = backContainerView.getConstraint(.Height) {
heightConstant.constant = isOpen == true ? contentView.bounds.size.height + yOffset : contentView.bounds.size.height
heightConstant.constant = isOpen == true ? frontContainerView.bounds.size.height + yOffset : frontContainerView.bounds.size.height
}
configurationCell()
if animated == true {
UIView.animateWithDuration(0.3, delay: 0, options: .CurveEaseInOut, animations: {
self.contentView.layoutIfNeeded()
@@ -178,6 +181,14 @@ extension BasePageCollectionCell {
return shadow
}
func configurationCell() {
frame.size.height += (superview?.frame.size.height)!
frame.origin.y -= (superview?.frame.size.height)! / 2
frame.origin.x -= yOffset / 2
frame.size.width += yOffset
}
}
// MARK: NSCoding
@@ -105,7 +105,7 @@ extension ExpandingViewController {
// MARK: UICollectionViewDataSource
extension ExpandingViewController: UICollectionViewDataSource, UICollectionViewDelegate{
extension ExpandingViewController: UICollectionViewDataSource, UICollectionViewDelegate {
public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
fatalError("need emplementation in subclass")
@@ -116,3 +116,15 @@ extension ExpandingViewController: UICollectionViewDataSource, UICollectionViewD
}
}
// MARK: UIScrollViewDelegate
extension ExpandingViewController {
public func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
let indexPath = NSIndexPath(forRow: currentIndex, inSection: 0)
if case let currentCell as BasePageCollectionCell = collectionView?.cellForItemAtIndexPath(indexPath) {
currentCell.configurationCell()
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'expanding-collection'
s.version = '0.1.1'
s.version = '0.2.0'
s.summary = 'Transition animtion from CollectionView to TableView'
s.license = 'MIT'
s.homepage = 'https://github.com/Ramotion/expanding-collection'