Changes

Jump to: navigation, search
no edit summary
let myLayout = MyFlowLayout()
self.collectionView?.setCollectionViewLayout(myLayout,
animated: true)
action: "handlePinch:")
self.collectionView?.addGestureRecognizer(pinchRecognizer)
// Uncomment the following line to preserve selection between presentations
// Register cell classes
// self.collectionView?.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier)
// Do any additional setup after loading the view.
func handlePinch(gesture: UIPinchGestureRecognizer) {
let layout = self.collectionView?.collectionViewLayout
as MyFlowLayout
// Convert pinch location into a specific cell
let pinchedCellPath =
self.collectionView?.indexPathForItemAtPoint(initialPinchPoint)
// Store the indexPath to cell
else
{
self.collectionView?.performBatchUpdates({
layout.currentCellPath = nil
layout.currentCellScale = 1.0}, completion:nil)
<pre>
let layout = self.collectionView?.collectionViewLayout as MyFlowLayout
</pre>
// Convert pinch location into a specific cell
let pinchedCellPath =
self.collectionView?.indexPathForItemAtPoint(initialPinchPoint)
// Store the indexPath to cell
else
{
self.collectionView?.performBatchUpdates({
layout.currentCellPath = nil
layout.currentCellScale = 1.0}, completion:nil)

Navigation menu