Swiftpack.co - DenTelezhkin/DTModelStorage as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
DenTelezhkin/DTModelStorage
Storage classes for datasource based controls
.package(url: "https://github.com/DenTelezhkin/DTModelStorage.git", from: "10.0.0-beta.1")

CI codecov.io CocoaPods compatible Platform Swift Package Manager compatible Packagist

DTModelStorage

Because this project main goal is to provide storage classes and mapping/event functionality for DTCollectionViewManager and DTTableViewManager, you should probably first read, why those two frameworks exist in the first place. This is described, for example, in Why document of DTCollectionViewManager.

Requirements

  • Xcode 12+
  • Swift 5.3+
  • iOS 11+ / tvOS 11+ / macCatalyst 13+

Installation

Swift Package Manager

  • Add package into Project settings -> Swift Packages

CocoaPods:

pod 'DTModelStorage'

Storage classes

The goal of storage classes is to provide datasource models for UITableView/UICollectionView. Let's take UITableView, for example. It's datasource methods mostly relates on following:

  • sections
  • items in sections
  • section headers and footers / supplementary views

Storage protocol builds upon those elements to define common interface for all storage classes. SupplementaryStorage protocol extends Storage to provide methods on supplementary models / headers/ footers.

Here are five Storage implementations provided by DTModelStorage and links to detailed documentation on them:

Please note, that all five storages support the same interface for handling supplementary models - supplementary providers. You can read more about them in dedicated document.

ViewModelMapping and EventReaction

ViewModelMapping and EventReaction classes are a part of mapping system between data models and reusable views. You can read about how they are used and why in DTCollectionViewManager Mapping document as well as DTCollectionViewManager Events document

GitHub

link
Stars: 79
Last commit: 4 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

10.0.0-beta.1
14 weeks ago

Removed

  • defersDatasourceUpdates on MemoryStorage. This property was deprecated in previous release and is now removed. MemoryStorage now always defers updates as if this property was turned on (which was the default).
  • ProxyDiffableDataSourceStorage. Diffable datasource integration has been restructured in a way, that no longer requires this class.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics