Skip to content

sparrowcode/DiffableKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

271 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiffableKit

Wrapper around UITableViewDiffableDataSource and UICollectionViewDiffableDataSource. Just call set() with your content whenever something changes — diffing, animations, and cell updates are handled automatically under the hood.

Built-in row types for settings screens. Cell provider, header/footer provider, delegate with actions — all wired up declaratively.

class SettingsController: DiffableTableController {

    override func viewDidLoad() {
        super.viewDidLoad()
        configureDiffable(
            sections: [
                DiffableSection(
                    id: "general",
                    header: DiffableTextHeaderFooter(text: "General"),
                    items: [
                        DiffableTableRow(text: "Theme", detail: "System", accessoryType: .disclosureIndicator)
                    ]
                )
            ],
            cellProviders: DiffableTableDataSource.CellProvider.default
        )
    }
}

About

Declarative wrapper for UIKit Diffable Data Source. Describe content, call set() — diffing and animations handled automatically.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages