Latest 1.0.0
Homepage https://github.com/Pelvs/JCVScroll
License MIT
Platforms ios 8.0
Authors

JCVScroll is a Swift class that contains a set of methods to create collapsable UIViews like CollapsingToolbar on Android.

Getting Started

You can easily start using this tool by adding it to your project using Cocoapods, Carthage or simply adding the source JCVScroll class into the project.

Using Cocoapods

pod 'JCVScroll'

Using Carthage

github "********"

Manually

add JCVScroll.swift into your project.

How to use

Import JCVScroll into your class:

import JCVScroll

There is two properties you can set for the collapsing animation:

  • Fade color (Default value is UIColor.clear)
    fadeColor = UIColor.black
  • Fade Speed, smaller fadeAnimationSpeed values means faster fade animations (Default value is 1).
    fadeAnimationSpeed = 1    /* can set this value from 0.0 to 1.0 */

    JCVScroll can handle as many views you need to collapse:

     setup(for views: [UIView], scrollView: UIScrollView, viewConstraints: [NSLayoutConstraint])

    Where:

  • view – Views that will be collapse.
  • scrollView – Scrollable component from the view.
  • viewConstraint – Top constraint from each collapsable view.
  • [UIView] and [NSLayoutConstraint] must be in the same order.

    Example:

    
    let views: [UIView] = [view1, view2, view3]
    let viewConstraints: [NSLayoutConstraint] = [topConstraintFromView1, topConstraintFromView2, topConstraintFromView3]

JCVScroll.setup(for: views, scrollView: scrollView, viewConstraints: viewConstraints)


#### IMPORTANT: Both methods needs to be added into the delegate method scrollViewDidScroll
Can be used on ScrollViews, TableViews or CollectionViews.

Latest podspec

{
    "name": "JCVScroll",
    "version": "1.0.0",
    "summary": "Collapsing view helper",
    "description": "JCVScroll is a class made in Swift that helps to create collapsing views on iOS just like collapsingToolbar on Android.",
    "homepage": "https://github.com/Pelvs/JCVScroll",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Pelvs": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Pelvs/JCVScroll.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "JCVScroll/Classes/**/*"
}

Pin It on Pinterest

Share This