Skip to content

Commit 5b627e1

Browse files
committed
Added assertion & documentation update
1 parent ec8047f commit 5b627e1

4 files changed

+13
-2
lines changed

.DS_Store

0 Bytes
Binary file not shown.
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = "CKWaveCollectionViewTransition"
3-
s.version = "1.0.0"
3+
s.version = "1.0.1"
44
s.summary = "Wave like transition between two or more collection view."
55
s.homepage = "https://github.com/CezaryKopacz/CKWaveCollectionViewTransition"
66
s.license = { :type => "MIT" }
77
s.author = { "Cezary Kopacz" => "salvation.sv@gmail.com" }
8-
s.source = { :git => "https://github.com/CezaryKopacz/CKWaveCollectionViewTransition.git", :tag => "1.0.0" }
8+
s.source = { :git => "https://github.com/CezaryKopacz/CKWaveCollectionViewTransition.git", :tag => "1.0.1" }
99
s.source_files = "Classes", "Classes/**/*.{swift}"
1010
s.ios.deployment_target = "8.0"
1111
end

Classes/CKWaveCollectionViewAnimator.swift

+2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ class CKWaveCollectionViewAnimator: NSObject, UIViewControllerAnimatedTransition
234234
}
235235

236236
private func enumerateVisibleCellsAndAddAnimations(destinationPoint: CGPoint, sourceCollectionViewController: UICollectionViewController, destinationCollectionViewController: UICollectionViewController) {
237+
238+
assert(destinationCollectionViewController.selectedIndexPath != nil, "Forgot to set selectedIndexPath property?")
237239

238240
var sourceIndexPathsForVisibleCells = sourceCollectionViewController.collectionView?.indexPathsForVisibleItems() as? Array<NSIndexPath>
239241
sourceIndexPathsForVisibleCells!.sort({ $0.row < $1.row })

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,17 @@ func navigationController(navigationController: UINavigationController, animatio
4848
}
4949
```
5050

51+
* The last thing you have to set is self.selectedIndexPath property in your didSelectItemAtIndexPath method implementation.
5152

5253

54+
```swift
55+
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
56+
57+
self.selectedIndexPath = indexPath
58+
...
59+
60+
}
61+
```
5362

5463

5564
## Properties

0 commit comments

Comments
 (0)