Skip to content
Smooth collection scrolling
Swift
Branch: master
Clone or download
Latest commit c38eb11 Dec 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AnimatedCollection.xcodeproj Readme and brand icon Dec 21, 2018
AnimatedCollection Readme and brand icon Dec 21, 2018
Screenshots Readme and brand icon Dec 21, 2018
SmoothScroll Initial commit Dec 21, 2018
.gitignore Initial commit Dec 18, 2018
LICENSE Readme and brand icon Dec 21, 2018
README.md Readme and brand icon Dec 21, 2018

README.md

Cuberto's development lab:

Cuberto is a leading digital agency with solid design and development expertise. We build mobile and web products for startups. Drop us a line.

SmoothScroll

Animation

Example

To run the example project, clone the repo and run AnimatedCollection.xcodeproj

Requirements

  • iOS 11.0+
  • Xcode 10.0

Installation

Add SmoothScroll folder to your project

Usage

  1. Create a new UICollectionView in your storyboard or nib (or instantiate it from code).

  2. Set layout to Custom and set its class to CBSmoothScrollLayout

  3. Register supplemetary views for Header, Menu and Title of kinds

  • CBSmoothScrollLayout.kCBAnimatedLayoutHeader
  • CBSmoothScrollLayout.kCBAnimatedLayoutMenu
  • CBSmoothScrollLayout.kCBAnimatedLayoutTitle respectively
  1. Check your collection view delegate to return right views from method collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath)

  2. Check your collection view delegate to conform UICollectionViewSmoothScrollLayoutDelegate protocol to provide correct size of title and handle animation progress

  3. Customize cells and supplementary views for your own purposes. You are free to inherit from base classes provided by us, or create your own from scratch

You can use provided CBViewAnimator to propagate animation state to all views that conforms to CBAnimatable protocol. Just register views to animator and call updateAnimation(toProgress progress: CGFloat) from delegate. All parts of layout can be tuned by changing params of CBSmoothScrollLayout

Author

Cuberto Design, info@cuberto.com

License

SmoothScroll is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.