riteshhgupta / Rglistkit
Licence: mit
RGListKit is a Protocol & MVVM based framework to easily populate a UITableView or UICollectionView via single api.
Stars: ✭ 178
Programming Languages
swift
15916 projects
Projects that are alternatives of or similar to Rglistkit
Thinningcoordinator
The UITableView/UICollectionView dataSource/delegate thinning coordinator, help thinning your UIViewController!
Stars: ✭ 25 (-85.96%)
Mutual labels: datasource, uicollectionview, uitableview
TinyCoordinator
The Swift version of ThinningCoordinator focus on lighter view controllers.
Stars: ✭ 18 (-89.89%)
Mutual labels: uitableview, uicollectionview, datasource
Flowkit
A declarative type-safe framework for building fast and flexible list with Tables & Collection
Stars: ✭ 215 (+20.79%)
Mutual labels: datasource, uicollectionview, uitableview
CollectionAndTableViewCompatible
A set of Swift protocols and Xcode snippets that will make it easy to do clean UITableView code
Stars: ✭ 34 (-80.9%)
Mutual labels: uitableview, uicollectionview, protocol
Genericdatasource
A generic small reusable components for data source implementation for UITableView/UICollectionView in Swift.
Stars: ✭ 127 (-28.65%)
Mutual labels: datasource, uicollectionview, uitableview
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+866.29%)
Mutual labels: datasource, uicollectionview, uitableview
Carbon
🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView.
Stars: ✭ 1,034 (+480.9%)
Mutual labels: datasource, uicollectionview, uitableview
iOSEasyList
A data-driven UICollectionView and UITableView framework for building fast and flexible lists
Stars: ✭ 29 (-83.71%)
Mutual labels: uitableview, uicollectionview, datasource
Dtcollectionviewmanager
Protocol-oriented UICollectionView management, powered by generics and associated types.
Stars: ✭ 300 (+68.54%)
Mutual labels: datasource, protocol, uicollectionview
Lpdmvvmkit
LPDMvvmKit - Elegant MVVM framework in Objective-C.
Stars: ✭ 400 (+124.72%)
Mutual labels: mvvm, uicollectionview, uitableview
Dttableviewmanager
Protocol-oriented UITableView management, powered by generics and associated types.
Stars: ✭ 424 (+138.2%)
Mutual labels: datasource, protocol, uitableview
Flix
iOS reusable form library in Swift.
Stars: ✭ 725 (+307.3%)
Mutual labels: uicollectionview, uitableview
Viewanimator
ViewAnimator brings your UI to life with just one line
Stars: ✭ 6,592 (+3603.37%)
Mutual labels: uicollectionview, uitableview
Changeset
Minimal edits from one collection to another
Stars: ✭ 807 (+353.37%)
Mutual labels: uicollectionview, uitableview
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (+298.31%)
Mutual labels: uicollectionview, uitableview
Hgplaceholders
Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project
Stars: ✭ 2,048 (+1050.56%)
Mutual labels: uicollectionview, uitableview
Modelassistant
Elegant library to manage the interactions between view and model in Swift
Stars: ✭ 26 (-85.39%)
Mutual labels: datasource, mvvm
Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (+478.65%)
Mutual labels: uicollectionview, uitableview
Gltablecollectionview
Netflix and App Store like UITableView with UICollectionView, written in pure Swift 4.2
Stars: ✭ 709 (+298.31%)
Mutual labels: uicollectionview, uitableview
Tangramkit
TangramKit is a powerful iOS UI framework implemented by Swift. It integrates the functions with Android layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,LayoutSizeClass to build your App 自动布局 UIView UITableView UICollectionView
Stars: ✭ 984 (+452.81%)
Mutual labels: uicollectionview, uitableview
RGListKit
RGListKit is a Protocol & MVVM based framework for populating UITableView
& UICollectionView
. It takes care of batch-reload as well which is powered by Dwifft.
Features
- No need to call
reloadData()
- No need to manage indexPaths to
performBatchUpdates(_:, completion:)
- No need to use different apis to populate UITableView & UICollectionView
- It works with multiple sections
- It works with multiple cell types
-
ListableView
, a protocol which unifies UITableView & UICollectionView -
ListManager
takes care of populating aListableView
-
[sections]
is all you need to set which acts like a datasource to populate aListableView
-
ItemModel
, a protocol which unifies UITableViewCell & UICollectionViewCell - Every cell is populated/configured via an
ItemModel
which is based on MVVM pattern - Decoupled diffing algorithm, powered by Dwifft
- Extendible API
- Written completely in Swift
Installation
Cocoapods
To integrate RGListKit into your Xcode project using CocoaPods, specify it in your Podfile:
Swift 3.1
pod 'RGListKit', :git => 'https://github.com/riteshhgupta/RGListKit.git', :branch => 'swift3'
Swift 4.0
pod 'RGListKit', :git => 'https://github.com/riteshhgupta/RGListKit.git'
Swift 4.0 + ReactiveSwift
pod 'RGListKit/ReactiveSwift', :git => 'https://github.com/riteshhgupta/RGListKit.git', :branch => 'swift4'
Example
UITableView
...
let tableView = UITableView()
let cellModels: [ItemModel] = [...]
let sectionModel = SectionModel(id: "section-one-id", cells: cellModels)
listManager = ListManager(listView: tableView)
listManager.sections = [sectionModel]
...
UICollectionView
...
let collectionView = UICollectionView()
let cellModels: [ItemModel] = [...]
let sectionModel = SectionModel(id: "section-one-id", cells: cellModels)
listManager = ListManager(listView: collectionView)
listManager.sections = [sectionModel]
...
Internal Architecture
- As you can see the api for populating UITableView or UICollectionView is identical, one of the benefits of using RGListKit.
-
ItemModel
defines a cell or even a header/footer-view for both UITableViewCell & UICollectionViewCell -
ListManager
has a propertysections
which when set triggers the view update - All the updates are by default batch-update but you can turn it off by setting
shouldPerformBatchUpdate = false
- You don't have to worry about indexPaths anymore, it uses diffing of old & new array of sections which calculates & performs the update for you.
- It doesn't intefere at all with custom views, like custom table cell or custom layout for collection view. RGListKit only takes care of your datasource and not the UI appearance. So you are free to use any custom layouts as required along with RGListKit.
- Since RGListKit consumes both
delegate
&datasource
so you can simply extendListManager
to handle any custom use cases likedidSelect
when required. All the methods will be available underListManager
e.g.
// UICollectionView
extension ListManager {
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
}
}
// UITableView
extension ListManager {
public func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
}
}
- There are couple of examples in the project itself which you can checkout or create an issue or ping me if anything comes up 👍
Blogs/Newsletter
List of online sources which have mentioned RGListKit,
- Natasha's Swift newsletter - issue #133
- Swift's Weekly - issue #78
- Compile Swift newsletter - issue #58
- iOS Cookies Newsletter - issue #82
Contributing
Contributions are welcome and encouraged! Open an issue or submit a pull request 🚀
Licence
RGListKit 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].