All Projects → younatics → Expandablecell

younatics / Expandablecell

Licence: mit
✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 5

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Expandablecell

Ynexpandablecell
✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 4
Stars: ✭ 445 (-20.39%)
Mutual labels:  expandable, collapsible, cell
Abexpandableview
Expandable, collapsible, filterable and single/multi selectable table view.
Stars: ✭ 138 (-75.31%)
Mutual labels:  expandable, collapsible
Campcotcollectionview
Collapse and expand UICollectionView sections with one method call.
Stars: ✭ 161 (-71.2%)
Mutual labels:  expandable, collapsible
Luexpandabletableview
A subclass of UITableView with expandable and collapsible sections
Stars: ✭ 125 (-77.64%)
Mutual labels:  expandable, collapsible
Expandableview
Expandable view for Xamarin.Forms
Stars: ✭ 178 (-68.16%)
Mutual labels:  expandable, collapsible
react-native-collapsible-list
A ReactNative collapsible list component
Stars: ✭ 70 (-87.48%)
Mutual labels:  collapsible
Collapsible Calendar View Android
Collapsible CalendarView is a simple calendar view which can be collapsed to save space and can be expanded when needed
Stars: ✭ 336 (-39.89%)
Mutual labels:  collapsible
AccordionRecycler
Android RecyclerView Adapter with nested items & expand/contract functionality
Stars: ✭ 17 (-96.96%)
Mutual labels:  expandable
BeefUp
Just a jQuery accordion plugin
Stars: ✭ 41 (-92.67%)
Mutual labels:  collapsible
Uitableviewdynamiclayoutcacheheight
🖖高性能的自动计算采用 Autolayout 布局的 UITableViewCell 和 UITableViewHeaderFooterView 的高度,内部自动管理高度缓存。
Stars: ✭ 360 (-35.6%)
Mutual labels:  cell
Vxe Table
🐬 vxe-table vue 表格解决方案
Stars: ✭ 4,242 (+658.86%)
Mutual labels:  cell
Mspeekcollectionviewdelegateimplementation
A custom paging behavior that peeks the previous and next items in a collection view
Stars: ✭ 265 (-52.59%)
Mutual labels:  cell
Flexibleadapter
Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Stars: ✭ 3,482 (+522.9%)
Mutual labels:  expandable
iOSEasyList
A data-driven UICollectionView and UITableView framework for building fast and flexible lists
Stars: ✭ 29 (-94.81%)
Mutual labels:  expandable
Commentreplycomponent
基于ExpandableListView实现评论和回复的功能。
Stars: ✭ 369 (-33.99%)
Mutual labels:  expandable
tcscustomrowactionfactory
TCSTableViewRowActionFactory allows you to setup the swipe actions for cells in a table view using UIView and some other convenient methods
Stars: ✭ 24 (-95.71%)
Mutual labels:  cell
Dropdowntextview
Simple drop-down(expandable) TextView for Android
Stars: ✭ 307 (-45.08%)
Mutual labels:  expandable
Expytableview
Make your table view expandable just by implementing one method.
Stars: ✭ 348 (-37.75%)
Mutual labels:  expandable
Vimpyter
Edit your Jupyter notebooks in Vim/Neovim
Stars: ✭ 308 (-44.9%)
Mutual labels:  cell
Azexpandableiconlistview
An expandable/collapsible view component written in Swift.
Stars: ✭ 284 (-49.19%)
Mutual labels:  collapsible

ExpandableCell

Awesome Version Carthage Compatible License: MIT Platform Swift 5.0 iOS 8.0+

Intoduction

Fully refactored YNExapnadableCell with more concise, bug free. Easiest usage of expandable & collapsible cell for iOS, written in Swift 5. You can customize expandable UITableViewCell whatever you like. ExpandableCell is made because insertRows and deleteRows is hard to use. Just inheirt ExpandableDelegate

demo

Usage

Basic

import ExpandableCell

Make ExpandableTableView in Storyboard or in code

@IBOutlet var tableView: ExpandableTableView!

Inherit ExpandableDelegate

class ViewController: UIViewController, ExpandableDelegate 

Set delegate

tableView.expandableDelegate = self

Set required ExpandableDelegate method.

Key two methods

Required ExpandableDelegate Explanation
func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCellsForRowAt indexPath: IndexPath) -> [UITableViewCell]? Key method to get expandable cells
func expandableTableView(_ expandableTableView: ExpandableTableView, heightsForExpandedRowAt indexPath: IndexPath) -> [CGFloat]? Key method to get expandable cells's height
Required UITableViewDelegate, UITableViewDataSource Explanation
func expandableTableView(_ expandableTableView: ExpandableTableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell -
func expandableTableView(_ expandableTableView: ExpandableTableView, numberOfRowsInSection section: Int) -> Int -
func expandableTableView(_ expandableTableView: ExpandableTableView, heightForRowAt indexPath: IndexPath) -> CGFloat -

Advanced

ExpandableTableView property

Property Type Explanation
animation UITableViewRowAnimation Animation when open and close
expansionStyle ExpandableTableView.ExpansionStyle Select expansion type:
single - one row at a time;
singlePerSection - one row at a time, per section;
multi - any number of rows at a time
autoRemoveSelection Bool autoRemoveSelection true means the cell will flicker selected, and autoRemoveSelection false means the default selection behaviour of the tableview will apply (single or multi selection)

ExpandableTableView methods

Method Explanation
openAll Open all that you set in func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCellsForRowAt indexPath: IndexPath) -> [UITableViewCell]?
closeAll Close all that you set in func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCellsForRowAt indexPath: IndexPath) -> [UITableViewCell]?
reloadData TableView reload data. Expanded cells will be work also
open(at indexPath: IndexPath) Open specific indexPath

Optional delegates

Optional ExpandableDelegate Explanation
func expandableTableView(_ expandableTableView: ExpandableTableView, didSelectExpandedRowAt indexPath: IndexPath) Get indexpath in expanded row
func expandableTableView(_ expandableTableView: ExpandableTableView, expandedCell: UITableViewCell, didSelectExpandedRowAt indexPath: IndexPath) Get expandedCell and indexPath
Optional UITableViewDelegate, UITableViewDataSource Explanation
func expandableTableView(_ expandableTableView: ExpandableTableView, didSelectRowAt indexPath: IndexPath) -
func expandableTableView(_ expandableTableView: ExpandableTableView, titleForHeaderInSection section: Int) -> String? -
func expandableTableView(_ expandableTableView: ExpandableTableView, heightForHeaderInSection section: Int) -> CGFloat -
func expandableTableView(_ expandableTableView: ExpandableTableView, viewForHeaderInSection section: Int) -> UIView? -
func numberOfSections(in expandableTableView: ExpandableTableView) -> Int -
func expandableTableView(_ expandableTableView: ExpandableTableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) -
func expandableTableView(_ expandableTableView: ExpandableTableView, willDisplayHeaderView view: UIView, forSection section: Int) -
func expandableTableView(_ expandableTableView: ExpandableTableView, willDisplayFooterView view: UIView, forSection section: Int) -

For arrow effect

Inherit ExpandableCell when you need arrow effect or change arrow image

open class ExpandableCell: UITableViewCell {
    open var arrowImageView: UIImageView!
}

For highlight animation

Inherit ExpandableCell when you need disable or enable highlight animation

open class ExpandableCell: UITableViewCell {
    open var highlightAnimation = HighlightAnimation.animated
}

Adding right margin to arrow icon

Inherit ExpandableCell when you need right margin ( Default margin is 16 )

open class ExpandableCell: UITableViewCell {
    open var rightMargin: CGFloat = 16
}

Set tableview insert animation

tableView.animation = .automatic

Make protocols in ExpandableDelegate if you need or make pull request to me :)

ExpandableCell methods

ExpandableCell methods Explanation
isExpanded() Check if cell is expanded or not
isInitiallyExpanded() Make cell be open when the tableView content first appears in the view
isSelectable() Make cell be selectable or not, regardless of tableView selectionStyle

Requirements

ExpandableCell written in Swift 5.0. Compatible with iOS 8.0+

Installation

Cocoapods

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

pod 'ExpandableCell'

Carthage

github "younatics/ExpandableCell"

References

Please tell me or make pull request if you use this library in your application :)

Author

younatics Twitter

License

ExpandableCell 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].