MultiHeaderTableView

main

edinsalimovic/MultiHeaderTableView

NSoft logo

MultiHeaderTableView

A simple library written in Swift.


Usage

MultiHeaderTableView provides a method to set the data:

public func set(sections: [MHSection])

MHSection.


MultiHeaderTableView provides the MultiHeaderTableViewDelegate.

public protocol MultiHeaderTableViewDelegate {
    var cells: [UITableViewCell.Type] { get }
    func cellForRowAt(tableView: UITableView, indexPath: IndexPath, row: MHRow) -> UITableViewCell
    func didSelectRowAt(row: MHRow, indexPath: IndexPath)
    var areSectionsExpandable: Bool { get }
    var shouldMoveToNextSection: Bool { get }
}

You need to provide:

  1. cells your table view cells.
  2. areSectionsExpandable This field will be used to enable the functionality to hide/show cells when the end user clicks on the header. When you click on the header, all sub rows will be hidden/showed.
  3. shouldMoveToNextSection This field will be used to enable the functionality to move the table view to the next available heading.
  4. cellForRowAt Implement this method to provide the cell for a row at a certain index path. Example.
  5. didSelectRowAt This function will be invoked when the user did select a row at a certain index path.

Examples

You can find the Demo 📁 MultiHeaderTableViewDemo.


Installation

Swift Package Manager
File > Add Package Dependencies...
Add https://github.com/edinsalimovic/MultiHeaderTableView.git


Requirements

  • iOS 8.0+

License

MultiHeaderTableView is released under the MIT license. See LICENSE for details.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Oct 05 2023 07:32:08 GMT-0900 (Hawaii-Aleutian Daylight Time)