Swiftpack.co - lightsprint09/Sourcing as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by lightsprint09.
lightsprint09/Sourcing v0.3.1
Abstracts TableView & CollectionView DataSources
⭐️ 17
🕓 10 weeks ago
iOS
.package(url: "https://github.com/lightsprint09/Sourcing.git", from: "v0.3.1")

Build Status Carthage Compatible codecov

Sourcing

Typesafe and flexible abstraction for TableView & CollectionView DataSources written in Swift. It helps you to seperate concerns and keep ViewControllers light. By operating on data providers replacing your view implementation is easy at any time.

Documentation

Read the docs. Generated with jazzy. Hosted by GitHub Pages.

Quick Demo

Setting up your Cell by implementing ConfigurableCell & ReuseIdentifierProviding.

import Sourcing

class LabelCell: UITableViewCell, ConfigurableCell {

   func configure(with label: String) {
      textLabel?.text = label
   }
   
}

//If the reuse identifier is the same as the class name.
extension LabelCell: ReuseIdentifierProviding {}

let labelCellConfiguration = CellConfiguration<LabelCell>()
let labelsToDispay = ArrayDataProvider(sections: [["Row 1", "Row 2"], ["Row 1", "Row 2"]])
let dataSource = TableViewDataSource(dataProvider: labelsToDispay, cellConfiguration: labelCellConfiguration)

tableView.dataSource = dataSource

//Add this to sync data changes to the table view.
let changeAnimator = TableViewChangeAnimator(tableView: tableView, dataProvider: labelsToDispay)

Installation

Swift Package Manager

SPM is integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Specify the following in your Package.swift:

.package(url: "https://github.com/lightsprint09/Sourcing", from: "4.1.0"),

Contributing

See CONTRIBUTING for details.

Contact

Lukas Schmidt (Mail, @lightsprint09)

License

Sourcing is released under the MIT license. See LICENSE for details.

GitHub

link
Stars: 17
Last commit: 10 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Batch Updates
1 year ago

Uses modern batch updates API

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