CollapsibleTableSectionViewController alternatives and similar libraries
Based on the "Table View / Collection View" category.
Alternatively, view CollapsibleTableSectionViewController alternatives based on common mentions on social networks and blogs.
-
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
MCSwipeTableViewCell
DISCONTINUED. 👆 Convenient UITableViewCell subclass that implements a swippable content to trigger actions (similar to the Mailbox app). -
HGPlaceholders
Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project -
ReverseExtension
A UITableView extension that enables cell insertion from the bottom of a table view. -
CenteredCollectionView
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift -
Bohr
DISCONTINUED. Bohr allows you to set up a settings screen for your app with three principles in mind: ease, customization and extensibility. -
CascadingTableDelegate
A no-nonsense way to write cleaner UITableViewDelegate and UITableViewDataSource in Swift. -
GLTableCollectionView
Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2 -
ListPlaceholder
ListPlaceholder is a swift library allows you to easily add facebook style animated loading placeholder to your tableviews or collection views. -
KDDragAndDropCollectionView
This component allows for the transfer of data items between collection views through drag and drop -
DataSources
💾 🔜📱 Type-safe data-driven CollectionView, TableView Framework. (We can also use ASCollectionNode) -
DTTableViewManager
Protocol-oriented UITableView management, powered by generics and associated types. -
TLIndexPathTools
TLIndexPathTools is a small set of classes that can greatly simplify your table and collection views. -
RHPreviewCell
I envied so much Spotify iOS app this great playlist preview cell 😍, I decided to create my own one 🌶. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". Great think is that this Library not requires 3D Touch support from user device💥. -
SquareMosaicLayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations :large_orange_diamond: -
HoverConversion
DISCONTINUED. HoverConversion realized vertical paging with UITableView. UIViewController will be paging when reaching top or bottom of UITableView contentOffset. -
GenericDataSource
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift. -
PJFDataSource
PJFDataSource is a small library that provides a simple, clean architecture for your app to manage its data sources while providing a consistent user interface for common content states (i.e. loading, loaded, empty, and error). -
AZCollectionViewController
Easy way to integrate pagination with dummy views in CollectionView, make Instagram "Discover" within minutes. -
ios-dragable-table-cells
DISCONTINUED. Objective-C library for drag-n-drop of UITableViewCells in a navigation hierarchy of view controllers.
Nutrient – The #1 PDF SDK Library, trusted by 10K+ developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CollapsibleTableSectionViewController or a related project?
Popular Comparisons
README
CollapsibleTableSectionViewController
A Swift library that helps you collapse table view sections.
Features
- Support collapsible sections in a table view
- Collapse all the sections by default (configurable)
- Keep only one section expanded (configurable)
- Auto resize table view cell
- Easy-to-use protocols for configuration
Requirements
- iOS 9.0+
- Xcode 10.0+
- Swift 4.2
Installation
Manual
Just clone and add the following Swift files to your project:
- CollapsibleTableSectionViewController.swfit
- CollapsibleTableViewHeader.swift
Cocoapods
- Make sure that you use latest stable Cocoapods version:
pod --version
- If not, update it:
sudo gem install cocoapods
pod init
in you project root dirnano Podfile
, add:use_frameworks! pod 'CollapsibleTableSectionViewController', '~> 2.0.1'
- Save it:
ctrl-x
,y
,enter
pod update
- Open generated
.xcworkspace
- Don't forget to import CollapsibleTableSectionViewController:
import CollapsibleTableSectionViewController
!
Carthage
nano Cartfile
- put
github "jeantimex/CollapsibleTableSectionViewController" ~> 2.0.1
into Cartfile - Save it:
ctrl-x
,y
,enter
- Run
carthage update
- Copy
CollapsibleTableSectionViewController.framework
fromCarthage/Build/iOS
to your project - Make sure that
CollapsibleTableSectionViewController
is added inEmbedded Binaries
section of your target (or else you will getdyld library not loaded referenced from ... reason image not found
error) - Add
import CollapsibleTableSectionViewController
on top of your view controller's code
Usage
Step 1. Subclass CollapsibleTableSectionViewController
import CollapsibleTableSectionViewController
class ViewController: CollapsibleTableSectionViewController { ... }
Step 2. Conforms to the CollapsibleTableSectionDelegate
protocol
extension ViewController: CollapsibleTableSectionDelegate { ... }
CollapsibleTableSectionDelegate Protocol
Most of the protocol methods are optional and they are very similar to UITableViewDataSource
and UITableViewDelegate
, here is a list of the available protocol methods:
1. optional func numberOfSections(_ tableView: UITableView) -> Int
Asks the data source to return the number of sections in the table view. Default is 1
.
extension ViewController: CollapsibleTableSectionDelegate {
func numberOfSections(_ tableView: UITableView) -> Int {
return 10
}
}
2. optional func collapsibleTableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
Returns the number of rows (table cells) in a specified section. Default is 0
.
extension ViewController: CollapsibleTableSectionDelegate {
func collapsibleTableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
}
3. optional func collapsibleTableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
Returns the table cell at the specified index path. You can also use your custom cells, see our example projects for more details.
extension ViewController: CollapsibleTableSectionDelegate {
func collapsibleTableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") as UITableViewCell? ?? UITableViewCell(style: .default, reuseIdentifier: "Cell")
cell.textLabel?.text = "Cell Text"
return cell
}
}
4. optional func shouldCollapseByDefault(_ tableView: UITableView) -> Bool
Return true
if you would like collapse all the sections when the table is loaded. Default is false
.
5. optional func shouldCollapseOthers(_ tableView: UITableView) -> Bool
Return true
if you would like to keep only one extended section (like accordion style). Default is false
.
6. optional func collapsibleTableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String?
The title for each section. Default is nil
.
7. optional func collapsibleTableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
Tells the delegate that the specified row is now selected.
Examples
Run the Examples project in this repo and you will find the following demos that help you get up and running:
- Basic: The minimal working example
- Custom Cell: Implement a custom cell programmatically
- Collapse By Default: All sections are collapsed by default
- Collapse Others: Accordion-style table view that only keeps one section expanded at a time
For more details of how to implement collapsible table sections using Swift, please checkout this repo for more information: https://github.com/jeantimex/ios-swift-collapsible-table-section.
Contribution
Anyone who would like to contribute to the project is more than welcome.
- Fork this repo
- Make your changes
- Submit pull request
License
MIT License
Copyright (c) 2017 Yong Su @jeantimex
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*Note that all licence references and agreements mentioned in the CollapsibleTableSectionViewController README section above
are relevant to that project's source code only.