CampcotCollectionView alternatives and similar libraries
Based on the "Collection View" category.
Alternatively, view CampcotCollectionView alternatives based on common mentions on social networks and blogs.
-
Carbon
🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView. -
MSPeekCollectionViewDelegateImplementation
A custom paging behavior that peeks the previous and next items in a collection view -
StableCollectionViewLayout
This layout adjusts a content offset if the collection view is updated. You can insert, delete or reload items and StableCollectionViewLayout will take care of the content offset. -
ThunderCollection
A wrapper around UICollectionViewController enabling a declarative API around it's delegate methods using protocols.
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of CampcotCollectionView or a related project?
README
This library provides a custom UICollectionView
that allows to expand and collapse sections. Provides a simple API to manage collection view appearance.
[CampcotCollectionView](Example/Assets/campcot.gif)
Requirements
- iOS 9.0+
- Xcode 10.2+
- Swift 5.0+
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate CampcotCollectionView 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
Manual Setup
import CampcotCollectionView
- Create CollectionView
swift let campcotCollectionView = CampcotCollectionView()
- Add
campcotCollectionView
to view hierarchy. Call
toggle
method oncampcotCollectionView
.public func toggle(to section: Int, offsetCorrection: CGFloat = default, animated: Bool, completion: ((Bool) -> Void)? = default)
Storyboard Setup
Add UICollectionView to your Storyboard.
In
Identity Inspector
set theClass
property toCampcotCollectionView
.Open
Attributes Inspector
and set theLayout
property toCustom
. SetClass
property to eitherExpandedLayout
orCollapsedLayout
.Create outlet for your collectionView.
Set datasource and delegate for collectionView.
Set the settings for collectionView in
Attributes Inspector
or manualy.
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)
*Note that all licence references and agreements mentioned in the CampcotCollectionView README section above
are relevant to that project's source code only.