All Projects → jadhavp → Jexpandabletableview

jadhavp / Jexpandabletableview

Licence: mit
JExpandableTableView provides out of box support for expandable table cells

Programming Languages

swift
15916 projects
swift3
66 projects

Projects that are alternatives of or similar to Jexpandabletableview

Buffer
Swift μ-framework for efficient array diffs and datasource adapters.
Stars: ✭ 349 (+558.49%)
Mutual labels:  tableview
Pulltorefreshkit
【Deprecated】Pull to refresh in Swift, easy to use, easy to customize(下拉刷新/QQ/淘宝/优酷/雅虎天气/大众点评)
Stars: ✭ 533 (+905.66%)
Mutual labels:  tableview
Modelassistant
Elegant library to manage the interactions between view and model in Swift
Stars: ✭ 26 (-50.94%)
Mutual labels:  tableview
Android Extensions
An Android library with modules to quickly bootstrap an Android application.
Stars: ✭ 356 (+571.7%)
Mutual labels:  tableview
Ynexpandablecell
✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 4
Stars: ✭ 445 (+739.62%)
Mutual labels:  tableview
Diffabledatasources
💾 A library for backporting UITableView/UICollectionViewDiffableDataSource.
Stars: ✭ 601 (+1033.96%)
Mutual labels:  tableview
Oycountdownmanager
在cell中使用倒计时的处理方法, 全局使用一个NSTimer对象, 支持单列表.多列表.多页面.分页列表使用
Stars: ✭ 317 (+498.11%)
Mutual labels:  tableview
Sortabletableview
An Android library containing a simple TableView and an advanced SortableTableView providing a lot of customisation possibilities to fit all needs.
Stars: ✭ 1,019 (+1822.64%)
Mutual labels:  tableview
Listplaceholder
ListPlaceholder is a swift library allows you to easily add facebook style animated loading placeholder to your tableviews or collection views.
Stars: ✭ 511 (+864.15%)
Mutual labels:  tableview
Datagrid
Gem to create tables grids with sortable columns and filters
Stars: ✭ 921 (+1637.74%)
Mutual labels:  tableview
Ezplayer
基于AVPlayer封装的视频播放器,功能丰富,快速集成,可定制性强,支持react-native。
Stars: ✭ 377 (+611.32%)
Mutual labels:  tableview
Flow
Declarative approach to populate and manage UITableViews (see https://github.com/malcommac/FlowKit)
Stars: ✭ 421 (+694.34%)
Mutual labels:  tableview
Swipecellkit
A swipeable UITableViewCell or UICollectionViewCell with support for:
Stars: ✭ 5,745 (+10739.62%)
Mutual labels:  tableview
React Native Tableview Simple
Flexible and lightweight React Native component for UITableView made with pure CSS
Stars: ✭ 357 (+573.58%)
Mutual labels:  tableview
Ssplaceholdertableview
SSPlaceholderTableView is Placeholder Library for different different state wise placeHolder for UITableView/UICollectionView. Check https://www.cocoacontrols.com/controls/ssplaceholdertableview
Stars: ✭ 39 (-26.42%)
Mutual labels:  tableview
Expytableview
Make your table view expandable just by implementing one method.
Stars: ✭ 348 (+556.6%)
Mutual labels:  tableview
Hvscrollview
这不是框架,只是3个示例程序,给大家提供一个实现这种布局的思路
Stars: ✭ 584 (+1001.89%)
Mutual labels:  tableview
React Native Ezplayer
EZPlayer component for react-native apps
Stars: ✭ 47 (-11.32%)
Mutual labels:  tableview
Legacytableview
simple light weight android library for displaying tabulated data
Stars: ✭ 39 (-26.42%)
Mutual labels:  tableview
Parallaxheader
Simple way to add parallax header to UIScrollView/UITableView written in Swift.
Stars: ✭ 808 (+1424.53%)
Mutual labels:  tableview

JExpandableTableView

JExpandableTableView provides out of box support for expandable table cells

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

App Preview ( Checkout live example app: courtesy Appetize )

Requirements

  • Xcode 8.x
  • Swift 3.x
  • iOS 8.0

Installation

JExpandableTableView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JExpandableTableView"

Features

  • Expandable cells
  • Allows to fetch cells asynchronously (refer tableView(_ tableView: JExpandableTableView, numberOfRowsInSection section: Int, callback: @escaping (Int) -> Void) method in Example)
  • Multple configaration for cell expansion and collapse
  • Easy integration through xib
  • Highly customizable - JExpandableTableView accepts any Header view and Custom cells which makes it very customizable similar to UITableView

Code Integration

Creating instance

  • Using interface builder, set class of any UIView to JExpandableTableView & create outlet in respective viewcontroller
    @IBOutlet weak var jtableView: JExpandableTableView!
  • Using interface builder, set class of any UIView to JExpandableTableView & create outlet in respective viewcontroller
    jtableView = JExpandableTableView(frame: <#T##CGRect#>)

Assign delegates, smilar to UITableView delegate

        jtableView.delegate = self
        jtableView.dataSource = self

Sample delegate methods given below, please refer Example app to get more information.

    func tableView(_ tableView: JExpandableTableView, numberOfRowsInSection section: Int, callback:  @escaping (Int) -> Void) {

        let sectionInfo = self.dataArray[section]

        if sectionInfo.cells.count != 0 {
            callback(sectionInfo.cells.count)
        }else{
            
            tableView.isUserInteractionEnabled = false
            SVProgressHUD.show(withStatus: "Loading chapters...")
            
            DispatchQueue.global().async {
                
                Thread.sleep(forTimeInterval: 2)
                DispatchQueue.main.sync {
                    tableView.isUserInteractionEnabled = true
                    SVProgressHUD.dismiss()
                    let sectionInfo = self.dataArray[section]
                    sectionInfo.cells.append(CellInfo("1. Prologue ",cellId: "TextCell"))
                    sectionInfo.cells.append(CellInfo("2. Bran I",cellId: "TextCell"))
                    sectionInfo.cells.append(CellInfo("3. Catelyn I",cellId: "TextCell"))
                    sectionInfo.cells.append(CellInfo("4. Daenerys I",cellId: "TextCell"))
                    sectionInfo.cells.append(CellInfo("5.  A Game of Thrones, very very long chapter beyond the wall",cellId: "TextCell"))
                    
                    callback(sectionInfo.cells.count)
                    
                }
            }
        }
    }
    
    func tableView(_ tableView: JExpandableTableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{
        
        let section = self.dataArray[indexPath.section]
        let row = section.cells[indexPath.row]

        let cellId = row.cellId
        let cell = tableView.dequeueReusableCell(withIdentifier: cellId!, for: indexPath)
    
        cell.contentView.backgroundColor = UIColor.white
        let label = cell.viewWithTag(11) as? UILabel
        label?.text = row.text
        return cell
    }
    
    func numberOfSections(in tableView: JExpandableTableView) -> Int {
        
        return dataArray.count
    }
    
    func tableView(_ tableView: JExpandableTableView, viewForHeaderInSection section: Int) -> UIView? {
        
        let section = self.dataArray[section]
        let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: "HeaderView")
        header?.contentView.backgroundColor = UIColor.groupTableViewBackground
        let label = header?.viewWithTag(11) as? UILabel
        label?.text = section.title
        return header
    }

Manually open/close Headers

Below code snippet copied from sample app, which demonstrate this feature

        jtableView.openHeader(section: 1);
        DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(4), execute: {
            jtableView.closeHeader(section: 1);

        })

Support UIRefreshControl

    jtableView.addRefreshControler(refreshControl: <UIRefreshControl>)

Contributing

If anyone interested in new additions to this repo please feel free to create pull request.

Author

Pramod Jadhav

License

JExpandableTableView is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].