DTTableViewManager
  • October 7, 2023

Features


  • Powerful mapping system between data models and cells, headers and footers
  •  Automatic datasource and interface synchronization.
  •  Flexible Memory/CoreData/Realm/diffable datasource storage options
  •  Powerful compile-time safe events system, that covers all of UITableView delegate methods
  •  Views created from code, XIB, or storyboard, automatic registration and dequeue
  •  Can be used with UITableViewController, or UIViewController with UITableView
  •  Unified syntax with DTCollectionViewManager
  •  Support for SwiftUI – backed cells in iOS 13+ / tvOS 13+ / macCatalyst 13+
  •  Complete documentation
  •  API Reference

Read more about latest 11.0 release and integration with SwiftUI!

Requirements


  • Xcode 13+
  • iOS 11.0+ / tvOS 11.0+ / macCatalyst 13.0+
  • Swift 5.3+

If you need Xcode 11 support or Swift 4…Swift 5.2, or iOS 8…iOS 10 support, you can use 7.x releases.

Installation


Swift Package Manager

Add package into Xcode Project settings -> Swift Packages

CocoaPods:

pod ‘DTTableViewManager’, ‘~> 11.0.0’

Quick start


Let’s say you have an array of Posts you want to display in UITableView. To quickly show them using DTTableViewManager, here’s what you need to do:

  1. Create UITableViewCell subclass, let’s say PostCell and adopt ModelTransfer protocol:

class PostCell : UITableViewCell, ModelTransfer {
func update(with model: Post) {
// Fill your cell with actual data
}
}

  1. In your view controller:

class PostsViewController: UITableViewController, DTTableViewManageable {

override func viewDidLoad() {
super.viewDidLoad()

// Register PostCell to be used with this controller’s table view
manager.register(PostCell.self)

// Populate datasource
manager.memoryStorage.setItems(posts)
}
}

Make sure your UITableView outlet is wired to your class (or use UITableViewController subclass). If you have a PostCell.xib file, it will be automatically used for dequeueing PostCell.

  1. That’s it! It’s that easy!

Of course, cool stuff does not stop there, framework supports all datasource and delegate methods as closures, conditional mappings and much much more! Choose what interests you in the next section of readme.

GitHub


View Github

#datasource #delegate #ios #protocol #swift #uitableview
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...