Savory alternatives and similar libraries
Based on the "Table View / Collection View" category.
Alternatively, view Savory alternatives based on common mentions on social networks and blogs.
-
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
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.
SaaSHub - Software Alternatives and Reviews
* 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 Savory or a related project?
README
Savory
Savory is a swift accordion view implementation.
[screencast](resources/screencast.gif)
Requirements
- Xcode 8.0
- Swift 3.0
- iOS 8
Installation
- Using CocoaPods:
pod 'Savory', :git => 'https://github.com/Nandiin/Savory.git'
- Using Carthage:
github "Nandiin/Savory"
then proceed with official steps stated in Carthage readme
- Manually:
Add the files in Savory folder to your project.
Usage
import UIKit
import Savory
class ViewController: UIViewController, SavoryViewDelegate {
var savoryView: SavoryView!
override func viewDidLoad() {
super.viewDidLoad()
/* 1. Initiate SavoryView */
savoryView = SavoryView(frame: view.frame)
// offset for status bar
savoryView.frame.origin.y = 20
savoryView.frame.size.height -= 20
/* 2. Provide a implementation of SavoryStateProtivder protocol */
// Savory providers a simple implementation - SimpleStateProvider
savoryView.stateProvider = SimpleStateProvider([.expanded, .collapsed, .collapsed])
/* 3. Set the reuse identifiers for header and body cells */
savoryView.headerIdentifier = "header"
savoryView.bodyIdentifier = "body"
/* 4. register the reuse identifiers */
savoryView.register(UITableViewCell.self, forCellReuseIdentifier: "header")
savoryView.register(UITableViewCell.self, forCellReuseIdentifier: "body")
/* 5. set the savoryDelegate */
savoryView.savoryDelegate = self
/* 6. add subview */
view.addSubview(savoryView)
}
func headerCell(forPanelAt index: SavoryPanelIndex, in savoryView: SavoryView) -> SavoryHeaderCell {
/* Dequeues a reusable cell */
// SavoryView provides a method to dequeue reusable header cell for certain index
// SavoryView internally dequeues a cell using its headerIdentifier as reuse identifier
let cell = savoryView.dequeueReusableHeaderCell(forPanelAt: index)
/* customize the cell */
cell.selectionStyle = .none
cell.textLabel?.text = "Header \(index)"
cell.backgroundColor = UIColor.lightGray
return cell
}
func bodyCell(forPanelAt index: SavoryPanelIndex, in savoryView: SavoryView) -> SavoryBodyCell {
// almost same as headerCell(forPanelAt:in:)
let cell = savoryView.dequeueReusableBodyCell(forPanelAt: index)
cell.textLabel?.numberOfLines = 0
cell.textLabel?.text = [String](repeating: "Body \(index)", count: index + 1).joined(separator: "\n")
return cell
}
}
Savory also can be used along with Interface Builder:
Set Class filed of a Table View to
SavoryView
in the Identity Inspector.Set Identifier fileds of two Table View Cells respectively in the Attributes Inspector.
Connect Table View to a view controller as outlet.
Set the
headerIdentifier
,bodyIdentifier
properties of the outlet, you should use the values set for Table View Cells above.Set
stateProvider
andsavoryDelegate
properties of the outlet.
Reference
Glossary
Header: The upper title bar of a accordion panel that consumes user selection event and then toggles the visibility of the Body.
Body: The lower view of a accordion panel that typically carrys detail information and would collapse or expand when user taps the corresponding Header.
SavoryView
Accordion effect view developed on UITableView
.
savoryDelegate
: Delegate that provides header and body cells for the view. It also receives event likewillCollapse
,willExpand
,didCollapse
,didExpand
anddidSelect
.stateProvider
: Another delegate that provides the state of the accordion view. SavoryView hasstateProvider.count
number of panels and i-th panel's expand-or-collapse state depends on the valuestateProvider[i]
.headerIdentifier, bodyIdentifier
:SavoryView
uses these properties inside itsdequeueReusableHeaderCell
anddequeueReusableBodyCell
method to dequeue reusable cells. So make sure these identifiers are registered to theSavoryView
instance somehow (programatically or in Interface Builder)dequeueReusableHeader(Body)Cell(forPanelAt:)
: LikedequeueReusableCell(withIdentifier:for:)
method forUITableView
, these methods dequeue reusable cells for panel at certain index.
SavoryStateProvider
SavoryView
renders its panels as collapsed or expanded based on its stateProvider
property.
Actually [SavoryPanelState]
type "conforms to" this protocol naturally. However, because swift hasn't supported an extension like below yet( may come soon according to apple/swift)
extension Array: SavoryStateProvider where Element == SavoryPanelState {}
Savory provides a wrapper implementation as SimpleStateProvider
and it requires a [SavoryPanelState]
for initializing and then it acts just like a stored array from SavoryView
's perspective.
For most circumstances, this is sufficient unless you want to provide some complex state managing feature.
Remember to call reloadData
on SavoryView
if you provided a custom implementation of SavoryStateProvider
and it changes its state programatically
TODO
- [ ] Animation synchronization
- [ ] Custom Animation
- [ ] Find a way to test commit cc2bc43ad436dc4d9d4a1390e68688e54b44ae12
- [ ] @IBDesignable
License
Savory is released under the MIT license. See [LICENSE](LICENSE) for details.
*Note that all licence references and agreements mentioned in the Savory README section above
are relevant to that project's source code only.