SwipeCellKit alternatives and similar libraries
Based on the "Table View / Collection View" category.
Alternatively, view SwipeCellKit alternatives based on common mentions on social networks and blogs.
-
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. -
Bohr
DISCONTINUED. Bohr allows you to set up a settings screen for your app with three principles in mind: ease, customization and extensibility. -
CenteredCollectionView
A lightweight UICollectionViewLayout that 'pages' and centers its cells 🎡 written in Swift -
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. -
CollapsibleTableSectionViewController
:tada: Swift library to support collapsible sections in a table view. -
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.
InfluxDB - Purpose built for real-time analytics at any scale.
* 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 SwipeCellKit or a related project?
README
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift.
About
A swipeable UITableViewCell
or UICollectionViewCell
with support for:
- Left and right swipe actions
- Action buttons with: text only, text + image, image only
- Haptic Feedback
- Customizable transitions: Border, Drag, and Reveal
- Customizable action button behavior during swipe
- Animated expansion when dragging past threshold
- Customizable expansion animations
- Support for both
UITableView
andUICollectionView
- Accessibility
- Dark Mode
Background
Check out my blog post on how SwipeCellKit came to be.
Demo
Transition Styles
The transition style describes how the action buttons are exposed during the swipe.
Border
Drag
Reveal
Customized
Expansion Styles
The expansion style describes the behavior when the cell is swiped past a defined threshold.
None
Selection
Destructive
Customized
Requirements
- Swift 5.0
- Xcode 10.3+
- iOS 9.0+
Installation
CocoaPods (recommended)
use_frameworks!
# Latest release in CocoaPods
pod 'SwipeCellKit'
# Get the latest on develop
pod 'SwipeCellKit', :git => 'https://github.com/SwipeCellKit/SwipeCellKit.git', :branch => 'develop'
# If you have NOT upgraded to Xcode 11, use the last Swift Xcode 10.X compatible release
pod 'SwipeCellKit', '2.6.0'
# If you have NOT upgraded to Swift 5.0, use the last Swift 4.2/Xcode 10.2 compatible release
pod 'SwipeCellKit', '2.5.4'
# If you have NOT upgraded to Swift 4.2, use the last non-swift 4.2 compatible release
pod 'SwipeCellKit', '2.4.3'
Carthage
github "SwipeCellKit/SwipeCellKit"
Swift Package Manager
dependencies: [
.package(url: "https://github.com/SwipeCellKit/SwipeCellKit", from: "2.7.1")
]
Documentation
Read the docs. Generated with jazzy. Hosted by GitHub Pages.
Usage for UITableView
Set the delegate
property on SwipeTableViewCell
:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") as! SwipeTableViewCell
cell.delegate = self
return cell
}
Adopt the SwipeTableViewCellDelegate
protocol:
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? {
guard orientation == .right else { return nil }
let deleteAction = SwipeAction(style: .destructive, title: "Delete") { action, indexPath in
// handle action by updating model with deletion
}
// customize the action appearance
deleteAction.image = UIImage(named: "delete")
return [deleteAction]
}
Optionally, you can implement the editActionsOptionsForRowAt
method to customize the behavior of the swipe actions:
func tableView(_ tableView: UITableView, editActionsOptionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeOptions {
var options = SwipeOptions()
options.expansionStyle = .destructive
options.transitionStyle = .border
return options
}
Usage for UICollectionView
Set the delegate
property on SwipeCollectionViewCell
:
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! SwipeCollectionViewCell
cell.delegate = self
return cell
}
Adopt the SwipeCollectionViewCellDelegate
protocol:
func collectionView(_ collectionView: UICollectionView, editActionsForItemAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? {
guard orientation == .right else { return nil }
let deleteAction = SwipeAction(style: .destructive, title: "Delete") { action, indexPath in
// handle action by updating model with deletion
}
// customize the action appearance
deleteAction.image = UIImage(named: "delete")
return [deleteAction]
}
Optionally, you can implement the editActionsOptionsForItemAt
method to customize the behavior of the swipe actions:
func collectionView(_ collectionView: UICollectionView, editActionsOptionsForItemAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeOptions {
var options = SwipeOptions()
options.expansionStyle = .destructive
options.transitionStyle = .border
return options
}
Transitions
Three built-in transition styles are provided by SwipeTransitionStyle
:
- .border: The visible action area is equally divide between all action buttons.
- .drag: The visible action area is dragged, pinned to the cell, with each action button fully sized as it is exposed.
- .reveal: The visible action area sits behind the cell, pinned to the edge of the table view, and is revealed as the cell is dragged aside.
See Customizing Transitions for more details on customizing button appearance as the swipe is performed.
Transition Delegate
Transition for a SwipeAction
can be observered by setting a SwipeActionTransitioning
on the transitionDelegate
property. This allows you to observe what percentage is visible and access to the underlying UIButton
for that SwipeAction
.
Expansion
Four built-in expansion styles are provided by SwipeExpansionStyle
:
- .selection
- .destructive (like Mail.app)
- .destructiveAfterFill (like Mailbox/Tweetbot)
- .fill
Much effort has gone into making SwipeExpansionStyle
extremely customizable. If these built-in styles do not meet your needs, see Customizing Expansion for more details on creating custom styles.
The built-in .fill
expansion style requires manual action fulfillment. This means your action handler must call SwipeAction.fulfill(style:)
at some point during or after invocation to resolve the fill expansion. The supplied ExpansionFulfillmentStyle
allows you to delete or reset the cell at some later point (possibly after further user interaction).
The built-in .destructive
, and .destructiveAfterFill
expansion styles are configured to automatically perform row deletion when the action handler is invoked (automatic fulfillment). Your deletion behavior may require coordination with other row animations (eg. inside beginUpdates
and endUpdates
). In this case, you can easily create a custom SwipeExpansionStyle
which requires manual fulfillment to trigger deletion:
var options = SwipeTableOptions()
options.expansionStyle = .destructive(automaticallyDelete: false)
NOTE: You must call
SwipeAction.fulfill(with style:)
at some point while/after your action handler is invoked to trigger deletion. Do not calldeleteRows
directly.
let delete = SwipeAction(style: .destructive, title: nil) { action, indexPath in
// Update model
self.emails.remove(at: indexPath.row)
action.fulfill(with: .delete)
}
Advanced
See the Advanced Guide for more details on customization.
Credits
Maintained by @mkurabi.
Showcase
We're interested in knowing who's using SwipeCellKit in their app. Please submit a pull request to add your app!
License
SwipeCellKit
is released under an MIT License. See LICENSE
for details.
Please provide attribution, it is greatly appreciated.
*Note that all licence references and agreements mentioned in the SwipeCellKit README section above
are relevant to that project's source code only.