Skip to content
Cool wave like transition between two or more UICollectionView
Branch: master
Clone or download
CezaryKopacz Merge pull request #12 from CezaryKopacz/swift_3
Swift 3 project settings & changed functions access level
Latest commit a40641d Oct 5, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Classes Swift 3 project settings & changed functions access level Oct 5, 2016
Example Swift 3 project settings & changed functions access level Oct 5, 2016
.gitignore
.swift-version Swift 3 project settings & changed functions access level Oct 5, 2016
CKWaveCollectionViewTransition.podspec Updated podspec Oct 5, 2016
LICENSE Added .podfile and LICENSE Jul 27, 2015
README.md Added assertion & documentation update Aug 30, 2015
anim.gif
usage1.jpg Readme update Aug 9, 2015
usage2.jpg
usage3.jpg

README.md

CKWaveCollectionViewTransition

This is a cool custom transition between two or more UICollectionViewControllers with wave like cell animation. Could be used in e.g. galleries.

anim.gif

Animation idea was taken from Łukasz Frankiewicz Dribble project

Installation

There are two options:

  • Via CocoaPods.
  • Manually add the files into your Xcode project. Slightly simpler, but updates are also manual.

Usage

  • In storyboard add object in your NavigationController.

object.jpg

  • Set it's class to NavigationControllerDelegate

objectCustomClass.jpg

  • Set NavigationController delegate to this object.

navigationControllerDelegateObject.jpg

or

Implement UINavigationControllerDelegate in your ViewController:

func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation,
        fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
            
            let animator = CKWaveCollectionViewAnimator()
            
            if operation != UINavigationControllerOperation.Push {
                
                animator.reversed = true
            }
            
            return animator
    }
  • The last thing you have to set is self.selectedIndexPath property in your didSelectItemAtIndexPath method implementation.
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
        
        self.selectedIndexPath = indexPath
...

}

Properties

internal let animationDuration: Double! = 1.0

Total animation duration

internal let kCellAnimSmallDelta: Double! = 0.01

Small delay between cell animations

internal let kCellAnimBigDelta: Double! = 0.03

Big delay between cell animations

Requirements

  • iOS 7.0+

License

Released under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.