Latest 1.2.0
License MIT
Platforms ios 8.0


What is the Gemini?

Gemini is rich scroll based animation framework for iOS, written in Swift. You can easily use GeminiCollectionView, which is a subclass of UICollectionView.

It enables you to make multiple animation which has various and customizable properties, and moreover can create your own custom scroll animation.

Gemini also provides a fluent interface based on method chaining. you can use this intuitively and simply.



Carthage compatible

  • [x] Rich animation with scrolling
  • [x] Easily usable
  • [x] Highly customizable
  • [x] Several types of animations and properties
  • [x] Support vertical and horizontal flow layout
  • [x] Support easing function
  • [x] Support Swift4.0
  • [x] Fluent interfaces based on method chaining
  • [x] Compatible with Carthage
  • [x] Compatible with CocoaPod
  • [x] Completely Example Project
  • [x] Completely README
  • [x] And More…


Animation Types and properties

Following animation types are available. You can find out sample code here.

In addition, you can also customize the following properties for the above animation types.


It’s a cube animation like Instagram.
If you would like to customize the cube animation, change cubeDegree.
If cubeDegree is 90, it moves like a regular hexahedron.



An animation moves in a circle. You can change circleRadius and CircleRotationDirection.

    .radius(450) // The radius of the circle
    .rotateDirection(.clockwise) // Direction of rotation. 
    .itemRotationEnabled(true) // Whether the item rotates or not.

3D vector rotation

Available for Roll, Pitch and Yaw animation. These rotation animation are designed based on 3-Dimensional vector. Figure-1 shows direction of rotation based on device.

Figure-1 Pitch, roll, and yaw axes

Reference: Event Handling Guide for UIKit Apps

Roll Rotation

Pitch Rotation

Yaw Rotation

Each types of rotation animation has RotationEffect(e.g. RollRotationEffect) and degree of rotation.

Customize RotationEffect (up, down, sineWave, reverseSineWave) and degree of rotation.

In the case of rollRotation, like this:



The scaleUp gradually increases frame size, scaleDown decreases.

    .scaleEffect(.scaleUp) // or .scaleDown


You can flexibly and easily customize scroll animation. Customize properties of GeminiAnimation.custom such as scale, scaleEffect, rotationAngle, translation, easing, shadowEffect, alpha, cornerRadius, backgroundColor, anchorPoint, etc.

The animation of gif is customized in the following way:

    .translation(y: 50)
    .rotationAngle(y: 13)

Or right side of gifs is customized as follows:

    .backgroundColor(startColor: lightGreenColor, endColor: lightBlueColor)

There are more sample code at CustomAnimationViewController.swift.

Easing function

Gemini supports various easing functions based on distance of scroll.

  • linear
  • easeInQuad
  • easeOutQuad
  • easeInOutQuad
  • easeInCubic
  • easeOutCubic
  • easeInOutCubic
  • easeInQuart
  • easeOutQuart
  • easeInOutQuart
  • easeInQuint
  • easeOutQuint
  • easeInOutQuint
  • easeInSine
  • easeOutSine
  • easeInOutSine
  • easeInExpo
  • easeOutExpo
  • easeInOutExpo
  • easeInCirc
  • easeOutCirc
  • easeInOutCirc

Shadow effect

Default value is ShadowEffect.none. Return shadowView in your custom class, which is a subclass of GeminiCell.

  • fadeIn
  • nextFadeIn
  • previousFadeIn
  • fadeOut
  • none
class CustomCollectionViewCell: GeminiCell {
    @IBOutlet weak var customShadowView: UIView!
    override var shadowView: UIView? {
        return customShadowView


  1. Use Gemini classes

Gemini is designed to be easy to use. Use GeminiCollectionView and GeminiCell. These classes is subclass of UICollectionView, UICollectionViewCell.

  1. Configure animation

Configure animation with fluent interface based on method chaining. You can develop expressive code that enhances readability.

  1. Call function for animation

Finally, call animateVisibleCells() in scrollViewDidScroll(_:)

NOTE: If you want to adapt animation immediately after view is displayed, call animateCell(_:) in collectionView(_:cellForItemAt:) and collectionView(_:willDisplay:forItemAt:).

// Import Gemini
import Gemini

// Inherite GeminiCell
class CustomCell: GeminiCell {

// Conform to UICollectionViewDelegate and UICollectionViewDataSource
class CustomViewController: UIViewController: UICollectionViewDelegate, UICollectionViewDataSource {

    // Inherite GeminiCollectionView
    @IBOutlet weak var collectionView: GeminiCollectionView!


    // Configure animation and properties
    func configureAnimation() {

    // Call animation function
    func scrollViewDidScroll(_ scrollView: UIScrollView) {

    func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
        if let cell = cell as? GeminiCell {

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CustomCell", for: indexPath) as! CustomCell
        return cell

See Example, for more details.

To run the example project, clone the repo, and run pod install from the Example directory first.


  • Xcode 9.0+
  • Swift 4.0



Gemini is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Gemini"


Add the following line to your Cartfile:

github "shoheiyokoyama/Gemini"


Shohei Yokoyama


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

Latest podspec

    "name": "Gemini",
    "version": "1.2.0",
    "summary": "Gemini is rich scroll animation framework for iOS, written in Swift.",
    "description": "Gemini is rich scroll animation framework for iOS, written in Swift. nnYou can easily use GeminiCollectionView, which is a subclass of UICollectionView.nnYou are available multiple animation which has various and customizable properties, and moreover can create your own custom scroll animation.nnGemini also provide a fluent interface based on method chaining. you can use this intuitively and simply.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "shoheiyokoyama": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.2.0"
    "platforms": {
        "ios": "8.0"
    "source_files": "Gemini/**/*",
    "pushed_with_swift_version": "4.0"

Pin It on Pinterest

Share This