QuickTableViewController alternatives and similar libraries
Based on the "UITableView" category.
Alternatively, view QuickTableViewController alternatives based on common mentions on social networks and blogs.
-
folding-cell
:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion -
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
DGElasticPullToRefresh
Elastic pull to refresh for iOS developed in Swift -
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift -
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. -
ExpandableCell
✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 5 -
GridView
Reusable GridView with excellent performance and customization that can be time table, spreadsheet, paging and more. -
DiffableDataSources
💾 A library for backporting UITableView/UICollectionViewDiffableDataSource. -
PullToRefreshSwift
iOS Simple Cool PullToRefresh Library. It is written in pure swift. -
KJCategories
Collection of native ios extensions and classes to boost development process. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV, CoreGraphics, os and more. 超实用开发加速工具收集 -
Hakuba
:cherry_blossom: Cellmodel-driven tableview manager -
YNExpandableCell
✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 4 -
CollapsibleTableSectionViewController
:tada: Swift library to support collapsible sections in a table view. -
ExpyTableView
Make your table view expandable just by implementing one method. -
WLEmptyState
WLEmptyState is an iOS based component that lets you customize the view when the dataset of a UITableView or a UICollectionView is empty. We created a sample project with the WLEmptyState component to show how you can use it. -
Shoyu
Easier way to represent the structure of UITableView. -
SwiftyComments
UITableView based component designed to display a hierarchy of expandable/foldable comments. -
AEAccordion
Simple and lightweight UITableViewController with accordion effect (expand / collapse cells) -
SectionScrubber
A component to quickly scroll between collection view sections -
SelectionList
Simple single-selection or multiple-selection checklist, based on UITableView -
SPDiffable
Wrapper of Apple Diffable Data Source. Including side bar and ready-use models. -
AZTableViewController
Elegant and easy way to integrate pagination with dummy views -
OKTableViewLiaison
Framework to help you better manage UITableViews -
FDTextFieldTableViewCell
A UITableViewCell with an editable text field -
CollapsibleTable
Collapsable table view sections with custom section header views. -
Doppelganger-Swift
Array diffs as collection view wants it - now in Swift ✨ -
CKTextFieldTableCell
UITableViewCell drop-in replacement with support of UITextField
Appwrite - The open-source backend cloud platform
* 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 QuickTableViewController or a related project?
README
QuickTableViewController
A simple way to create a table view for settings, including:
- Table view cells with
UISwitch
- Table view cells with center aligned text for tap actions
- A section that provides mutually exclusive options
- Actions performed when the row reacts to the user interaction
- Easy to specify table view cell image, cell style and accessory type
Usage
Set up tableContents
in viewDidLoad
:
import QuickTableViewController
final class ViewController: QuickTableViewController {
override func viewDidLoad() {
super.viewDidLoad()
tableContents = [
Section(title: "Switch", rows: [
SwitchRow(text: "Setting 1", switchValue: true, action: { _ in }),
SwitchRow(text: "Setting 2", switchValue: false, action: { _ in })
]),
Section(title: "Tap Action", rows: [
TapActionRow(text: "Tap action", action: { [weak self] in self?.showAlert($0) })
]),
Section(title: "Navigation", rows: [
NavigationRow(text: "CellStyle.default", detailText: .none, icon: .named("gear")),
NavigationRow(text: "CellStyle", detailText: .subtitle(".subtitle"), icon: .named("globe")),
NavigationRow(text: "CellStyle", detailText: .value1(".value1"), icon: .named("time"), action: { _ in }),
NavigationRow(text: "CellStyle", detailText: .value2(".value2"))
], footer: "UITableViewCellStyle.Value2 hides the image view."),
RadioSection(title: "Radio Buttons", options: [
OptionRow(text: "Option 1", isSelected: true, action: didToggleSelection()),
OptionRow(text: "Option 2", isSelected: false, action: didToggleSelection()),
OptionRow(text: "Option 3", isSelected: false, action: didToggleSelection())
], footer: "See RadioSection for more details.")
]
}
// MARK: - Actions
private func showAlert(_ sender: Row) {
// ...
}
private func didToggleSelection() -> (Row) -> Void {
return { [weak self] row in
// ...
}
}
}
NavigationRow
Detail Text Styles
NavigationRow(text: "UITableViewCellStyle.default", detailText: .none)
NavigationRow(text: "UITableViewCellStyle", detailText: .subtitle(".subtitle")
NavigationRow(text: "UITableViewCellStyle", detailText: .value1(".value1")
NavigationRow(text: "UITableViewCellStyle", detailText: .value2(".value2"))
Subtitle
and the initializers with title/subtitle are deprecated and will be removed in v2.0.0.
Accessory Type
- The
NavigationRow
shows with different accessory types based on theaction
andaccessoryButtonAction
closures:
var accessoryType: UITableViewCell.AccessoryType {
switch (action, accessoryButtonAction) {
case (nil, nil): return .none
case (.some, nil): return .disclosureIndicator
case (nil, .some): return .detailButton
case (.some, .some): return .detailDisclosureButton
}
}
- The
action
will be invoked when the table view cell is selected. - The
accessoryButtonAction
will be invoked when the accessory button is selected.
Images
enum Icon {
case named(String)
case image(UIImage)
case images(normal: UIImage, highlighted: UIImage)
}
- Images in table view cells can be set by specifying the
icon
of each row. - Table view cells in
UITableViewCellStyle.value2
will not show the image view.
SwitchRow
- A
SwitchRow
is representing a table view cell with aUISwitch
as itsaccessoryView
. - The
action
will be invoked when the switch value changes.
TapActionRow
- A
TapActionRow
is representing a button-like table view cell. - The
action
will be invoked when the table view cell is selected. - The icon, detail text, and accessory type are disabled in
TapActionRow
.
OptionRow
- An
OptionRow
is representing a table view cell with.checkmark
. - The
action
will be invoked when the selected state is toggled.
let didToggleSelection: (Row) -> Void = { [weak self] in
if let option = $0 as? OptionRowCompatible, option.isSelected {
// to exclude the event where the option is toggled off
}
}
RadioSection
RadioSection
allows only one selected option at a time.- Setting
alwaysSelectsOneOption
to true will keep one of the options selected. OptionRow
can also be used withSection
for multiple selections.
Customization
Rows
All rows must conform to Row
and RowStyle
. Additional interface to work with specific types of rows are represented as different protocols:
NavigationRowCompatible
OptionRowCompatible
SwitchRowCompatible
TapActionRowCompatible
Cell Classes
A customized table view cell type can be specified to rows during initialization.
// Default is UITableViewCell.
NavigationRow<CustomCell>(text: "Navigation", detailText: .none)
// Default is SwitchCell.
SwitchRow<CustomSwitchCell>(text: "Switch", switchValue: true, action: { _ in })
// Default is TapActionCell.
TapActionRow<CustomTapActionCell>(text: "Tap", action: { _ in })
// Default is UITableViewCell.
OptionRow<CustomOptionCell>(text: "Option", isSelected: true, action: { _ in })
Since the rows carry different cell types, they can be matched using either the concrete types or the related protocol:
let action: (Row) -> Void = {
switch $0 {
case let option as OptionRow<CustomOptionCell>:
// only matches the option rows with a specific cell type
case let option as OptionRowCompatible:
// matches all option rows
default:
break
}
}
Overwrite Default Configuration
You can use register(_:forCellReuseIdentifier:)
to specify custom cell types for the table view to use. See CustomizationViewController for the cell reuse identifiers of different rows.
Table view cell classes that conform to Configurable
can take the customization during tableView(_:cellForRowAt:)
:
protocol Configurable {
func configure(with row: Row & RowStyle)
}
Additional setups can also be added to each row using the customize
closure:
protocol RowStyle {
var customize: ((UITableViewCell, Row & RowStyle) -> Void)? { get }
}
The customize
closure overwrites the Configurable
setup.
UIAppearance
As discussed in issue #12, UIAppearance customization works when the cell is dequeued from the storyboard. One way to work around this is to register nib objects to the table view. Check out AppearanceViewController for the setup.
tvOS Differences
UISwitch
is replaced by a checkmark inSwitchCell
.TapActionCell
does not use center aligned text.NavigationRow.accessoryButtonAction
is not available.- Cell image view's left margin is 0.
Limitation
When to use QuickTableViewController?
QuickTableViewController is good for presenting static table contents, where the sections and rows don't change dynamically after viewDidLoad
.
It's possible to update the table contents by replacing a specific section or row. Using different styles on each row requires additional configuration as described in the Customization section.
When not to use it?
QuickTableViewController is not designed for inserting and deleting rows. It doesn't handle table view reload animation either. If your table view needs to update dynamically, you might want to consider other solutions such as IGListKit.
Documentation
Requirements
Pre 1.0 versions
QuickTableViewController | iOS | tvOS | Xcode | Swift |
---|---|---|---|---|
~> 0.1.0 |
8.0+ | - | 6.4 | 1.2 |
~> 0.2.0 |
8.0+ | - | 7.0 | 2.0 |
~> 0.3.0 |
8.0+ | - | 7.3 | 2.2 |
~> 0.4.0 |
8.0+ | - | 8.0 | 2.3 |
~> 0.5.0 |
8.0+ | - | 8.0 | 3.0 |
~> 0.6.0 |
8.0+ | - | 8.3 | 3.1 |
~> 0.7.0 |
8.0+ | - | 9.0 | 3.2 |
~> 0.8.0 |
8.0+ | - | 9.1 | 4.0 |
~> 0.9.0 |
8.0+ | - | 9.3 | 4.1 |
QuickTableViewController | iOS | tvOS | Xcode | Swift |
---|---|---|---|---|
~> 1.0.0 |
8.0+ | 9.0+ | 9.4 | 4.1 |
~> 1.1.0 |
8.0+ | 9.0+ | 10.1 | 4.2 |
~> 1.2.0 |
8.0+ | 9.0+ | 10.2 | 5.0 |
~> 1.3.0 |
9.0+ | 9.0+ | 11.7 | 5.2 |
Installation
Use Swift Package Manager
Follow the instructions at Adding Package Dependencies to Your App and use version v1.2.1
or later. (requires Xcode 11)
Use CocoaPods
Create a Podfile
with the following specification and run pod install
.
platform :ios, '9.0'
use_frameworks!
pod 'QuickTableViewController'
Use Carthage
Create a Cartfile
with the following specification and run carthage update QuickTableViewController
.
Follow the instructions to add the framework to your project.
github "bcylin/QuickTableViewController"
Xcode 12 workaround Guide: https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.mdx
Use Git Submodule
git submodule add -b master [email protected]:bcylin/QuickTableViewController.git Dependencies/QuickTableViewController
- Drag QuickTableViewController.xcodeproj to your app project as a subproject.
- On your application target's Build Phases settings tab, add QuickTableViewController-iOS to Target Dependencies.
License
QuickTableViewController is released under the MIT license. See LICENSE for more details. Image source: iconmonstr.
*Note that all licence references and agreements mentioned in the QuickTableViewController README section above
are relevant to that project's source code only.