- July 26, 2025
- Mins Read
This library provides a custom UICollectionView
that allows to expand and collapse sections. Provides a simple API to manage collection view appearance.
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
import CampcotCollectionView
let campcotCollectionView = CampcotCollectionView()
campcotCollectionView
to view hierarchy.toggle
method on campcotCollectionView
.
public func toggle(to section: Int,
offsetCorrection: CGFloat = default,
animated: Bool,
completion: ((Bool) -> Void)? = default)
Identity Inspector
set the Class
property to CampcotCollectionView
.Attributes Inspector
and set the Layout
property to Custom
. Set Class
property to either ExpandedLayout
or CollapsedLayout
.Attributes Inspector
or manualy.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)
NavigationKit is a lightweight library which makes SwiftUI navigation super easy to use. 💻 Installation 📦 Swift Package Manager Using Swift Package Manager, add ...
An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation. NavigationStack Installation ...
With SwiftUI Router you can power your SwiftUI app with path-based routing. By utilizing a path-based system, navigation in your app becomes ...
This package takes SwiftUI's familiar and powerful NavigationStack API and gives it superpowers, allowing you to use the same API not just ...