Sapporo alternatives and similar libraries
Based on the "Table View / Collection View" category.
Alternatively, view Sapporo 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 Sapporo or a related project?
README
Sapporo
cellmodel-driven collectionview manager
Features
- Easy to manage your sections and cells (reset/insert/append/remove/update)
- Don't have to write the code for
UICollectionViewDelegate
andUICollectionViewDataSource
protocols - Don't need to care about cell identifier
- Handle cell selection by trailing closure
- Supports method chaining
- Supports subscript
- Complete example
Quick example
// viewController swift file
let sapporo = Sapporo(collectionView: self.collectionView)
let cellmodel = YourCellModel(title: "Title", des: "description") {
println("Did select cell with title = \(title)")
}
let topSection = SASection()
sapporo
.reset(topSection)
.bump()
topSection
.append(cellmodel) // append a new cell model in datasource
.bump() // show the new cell in the collection view
topSection
.remove(1...3)
.bump()
topSection
.move(fromIndex: 0, toIndex: 3)
.bump()
// your cell swift file
class YourCellModel : SACellModel {
let title: String
let des: String
init(title: String, des: String, selectionHandler: (SACell) -> Void) {
self.title = title
self.des = des
super.init(cellType: YourCell.self, selectionHandler: selectionHandler)
}
}
class YourCell : SACell, SACellType {
typealias CellModel = YourCellModel
@IBOutlet weak var titleLabel: UILabel!
override func configure() {
super.configure()
guard let cellmodel = cellmodel else {
return
}
titleLabel.text = cellmodel.title
}
}
Usage
- Handling section
// retrieve a section or create a new section if it doesn't already exist
let section = sapporo[0]
// inserting
sapporo.insert(section, atIndex: 1)
.bump()
// moving
sapporo.move(fromIndex: 1, toIndex: 5)
.bump()
// removing
sapporo.remove(index)
.bump()
// remove all data
sapporo.reset()
.bump()
// handing section index by enum
enum Section: Int, SASectionIndexType {
case top
case center
case bottom
static let count = 3
}
let topSection = sapporo[Section.Top]
- Handling cell
// appending
sapporo[0]
.append(cellmodel) // append a cellmodel
.bump() // and bump to show the cell in the collection view
sapporo[TopSection]
.append(cellmodels) // append a list of cellmodels
.bump()
// by using section
let section = sapporo[Section.Top]
section
.append(cellmodel)
.bump()
// 2. inserting
section
.insert(cellmodels, atIndex: 1)
.bump()
section
.insertBeforeLast(cellmodels)
.bump()
// 3. reseting
section
.reset(cellmodels) // replace current data in section by the new data
.bump()
section
.reset() // or remove all data in section
.bump()
// 4. moving
section
.move(fromIndex: 5, toIndex: 1)
.bump()
// 5. removing
section
.remove(1)
.bump()
section
.remove(cellmodel)
.bump()
section
.remove(2...5)
.bump()
section
.removeLast()
.bump()
// updating cell
let cellmodel = section[1]
cellmodel.property = newData
cellmodel.bump()
// able to retrieve a cellmodel by indexpath
let cellmodel = sapporo[indexpath]
- Registering cell, header, footer, reusable view
sapporo
.registerCellByNib(CustomCell)
.registerCell(SimpleCell)
.registerSupplementaryViewByNib(HeaderView.self, kind: "SectionHeader")
- Customizing layout
In case you want to customize the layout of collection view, just create a subclass of SALayout and call setLayout
method to set the new layout instance.
class CustomLayout: SALayout {
// the implementation for your layout
}
let layout = CustomLayout()
sapporo.setLayout(layout)
Installation
Using Carthage
- Insert github
nghialv/Sapporo
to your Cartfile - Run
carthage update
- Insert github
Using CocoaPods
- Insert followings to your Podfile ``` use_frameworks!
target 'YOUR_TARGET_NAME' do pod 'Sapporo' end
- Run `pod install`
Using submodule
Requirements
- iOS 9.0+
- Xcode 9+
- Swift 4
License
Sapporo is released under the MIT License.
*Note that all licence references and agreements mentioned in the Sapporo README section above
are relevant to that project's source code only.