Latest 0.0.2
Homepage https://github.com/touchlane/CampcotCollectionView
License MIT
Platforms ios 9.0
Authors

LOGO

Build Status
codecov.io
Version
License
Platform

This library provides a custom UICollectionView that allows to expand and collapse sections. Provides a simple API to manage collection view appearance.

CampcotCollectionView

Requirements

  • iOS 9.0+
  • Xcode 9.0+
  • Swift 4.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate SlideController into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'CampcotCollectionView'
end

Then, run the following command:

$ pod install

Usage

import CampcotCollectionView
  1. Create CollectionView
    let campcotCollectionView = CampcotCollectionView()
  2. Add campcotCollectionView to view hierarchy.
  3. Call toggle method on campcotCollectionView.
    public func toggle(to section: Int,
                   offsetCorrection: CGFloat = default,
                   animated: Bool,
                   completion: ((Bool) -> Void)? = default)

Documentation

CampcotCollectionView

A Boolean value that determines whether the sections are expanded.

public var isExpanded: Bool { get }

Expands all the sections. Pins a section at index section to the top of view bounds.
offsetCorrection – the offset for pinned section from the top. Default value of offsetCorrection is 0.
animated – if true expands sections with animation.
completion – callback for animation.

public func expand(from section: Int,
                   offsetCorrection: CGFloat = default,
                   animated: Bool, 
                   completion: ((Bool) -> Void)? = default)

Collapses all the sections. Pins a section at index section to the top of view bounds.
offsetCorrection – the offset for pinned section from the top. Default value of offsetCorrection is 0.
animated – if true collapses sections with animation.
completion – callback for animation.

public func collapse(to section: Int,
                     offsetCorrection: CGFloat = default,
                     animated: Bool,
                     completion: ((Bool) -> Void)? = default)

Toggles current state from collapsed to expaned and vise versa. Pins a section at index section to the top of view bounds.
offsetCorrection – the offset for pinned section from the top. Default value of offsetCorrection is 0.
animated – if true toggles sections with animation.
completion – callback for animation.

public func toggle(to section: Int,
                   offsetCorrection: CGFloat = default,
                   animated: Bool,
                   completion: ((Bool) -> Void)? = default)

Latest podspec

{
    "name": "CampcotCollectionView",
    "version": "0.0.2",
    "summary": "CapmcotCollectionView is custom UICollectionView that allows to expand and collapse sections.",
    "description": "This library provides a custom UICollectionView that allows to expand and collapse sections.It provides a simple API to manage collection view appearance.",
    "homepage": "https://github.com/touchlane/CampcotCollectionView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Touchlane LLC": "[email protected]"
    },
    "source": {
        "git": "https://github.com/touchlane/CampcotCollectionView.git",
        "tag": "0.0.2"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Source/*.swift",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This