All Projects → shoheiyokoyama → Gemini

shoheiyokoyama / Gemini

Licence: mit
Gemini is rich scroll based animation framework for iOS, written in Swift.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Gemini

Anim
Swift animation library for iOS, tvOS and macOS.
Stars: ✭ 520 (-82.46%)
Mutual labels:  cocoapods, carthage, animation-library
Centeredcollectionview
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift
Stars: ✭ 965 (-67.45%)
Mutual labels:  cocoapods, carthage, uicollectionview
Koyomi
Simple customizable calendar component in Swift 📆
Stars: ✭ 716 (-75.85%)
Mutual labels:  cocoapods, carthage, uicollectionview
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+264.38%)
Mutual labels:  carthage, ios-animation, uicollectionview
Nvactivityindicatorview
A collection of awesome loading animations
Stars: ✭ 10,031 (+238.31%)
Mutual labels:  cocoapods, carthage, ios-animation
Chromacolorpicker
🎨 An intuitive iOS color picker built in Swift.
Stars: ✭ 434 (-85.36%)
Mutual labels:  cocoapods, carthage, ios-animation
Tkswitchercollection
An animation switch collection
Stars: ✭ 877 (-70.42%)
Mutual labels:  cocoapods, carthage, ios-animation
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Stars: ✭ 3,395 (+14.5%)
Mutual labels:  cocoapods, carthage, uicollectionview
Tkdotsegment
TKDotSegment is a segment with dot animation
Stars: ✭ 103 (-96.53%)
Mutual labels:  cocoapods, carthage, ios-animation
Tkrubberindicator
A rubber animation pagecontrol
Stars: ✭ 1,337 (-54.91%)
Mutual labels:  cocoapods, carthage, ios-animation
Swipemenuviewcontroller
Swipable tab and menu View and ViewController.
Stars: ✭ 926 (-68.77%)
Mutual labels:  cocoapods, carthage, animation-library
Donut
Donut is a library for arranging views circularly like a donut.
Stars: ✭ 141 (-95.24%)
Mutual labels:  cocoapods, carthage, animation-library
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (-60.2%)
Mutual labels:  cocoapods, carthage, ios-animation
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (-41.99%)
Mutual labels:  cocoapods, carthage, uicollectionview
Admozaiccollectionviewlayout
ADMozaicCollectionViewLayout is yet another UICollectionViewLayout subclass that implements "brick", "mozaic" or Pinterest style layout.
Stars: ✭ 226 (-92.38%)
Mutual labels:  cocoapods, carthage, uicollectionview
Simplecheckbox
A simple Checkbox
Stars: ✭ 253 (-91.47%)
Mutual labels:  cocoapods, carthage
Wechatkit
一款快速实现微信第三方登录的框架(Swift版) SDK 1.8.5
Stars: ✭ 249 (-91.6%)
Mutual labels:  cocoapods, carthage
Corestore
Unleashing the real power of Core Data with the elegance and safety of Swift
Stars: ✭ 3,254 (+9.75%)
Mutual labels:  cocoapods, carthage
Colorizeswift
Terminal string styling for Swift.
Stars: ✭ 253 (-91.47%)
Mutual labels:  cocoapods, carthage
Harpy
Harpy checks a user's currently installed version of your iOS app against the version that is currently available in the App Store. If a new version is available, an alert can be presented to the user informing them of the newer version, and giving them the option to update the application.
Stars: ✭ 2,619 (-11.67%)
Mutual labels:  cocoapods, carthage

Overview

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.

collectionView.gemini
    .circleRotationAnimation()
    .radius(400)
    .rotateDirection(.clockwise)

Features

Platform Cocoapods Carthage compatible License Swift pod

  • Rich animation with scrolling
  • Easily usable
  • Highly customizable
  • Several types of animations and properties
  • Supports vertical and horizontal flow layout
  • Supports easing function
  • Supports Swift5.0
  • Fluent interfaces based on method chaining
  • Compatible with Carthage
  • Compatible with CocoaPods
  • Example project with lots of stock animations
  • And More...

Contents

Animation Types and properties

The following animation types are available. See sample code here for details.

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

Cube

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.

collectionView.gemini
    .cubeAnimation()
    .cubeDegree(90)

CircleRotation

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

collectionView.gemini
    .circleRotationAnimation()
    .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:

collectionView.gemini
    .rollRotationAnimation()
    .degree(45)
    .rollEffect(.rollUp)

Scale

The scaleUp gradually increases frame size, scaleDown decreases.

collectionView.gemini
    .scaleAnimation()
    .scale(0.75)
    .scaleEffect(.scaleUp) // or .scaleDown

Custom

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:

collectionView.gemini
    .customAnimation()
    .translation(y: 50)
    .rotationAngle(y: 13)
    .ease(.easeOutExpo)
    .shadowEffect(.fadeIn)
    .maxShadowAlpha(0.3)

Or right side of gifs is customized as follows:

collectionView.gemini
    .customAnimation()
    .backgroundColor(startColor: lightGreenColor, endColor: lightBlueColor)
    .ease(.easeOutSine)
    .cornerRadius(75)

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
    }
}

Usage

  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() {
        collectionView.gemini
            .circleRotationAnimation()
            .radius(400)
            .rotateDirection(.clockwise)
    }

    // Call animation function
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        collectionView.animateVisibleCells()
    }

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

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

See Example, for more details.

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

Requirements

  • Xcode 10.2.1
  • Swift 5.0

Installation

CocoaPods

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

pod "Gemini"

Carthage

Add the following line to your Cartfile:

github "shoheiyokoyama/Gemini"

Author

Shohei Yokoyama

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].