Skip to content

Latest commit

 

History

281 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

DiffableKit

Declarative wrapper around UITableViewDiffableDataSource and UICollectionViewDiffableDataSource. Describe sections and items, call set() — diffing, animations, and cell updates are handled automatically.

Installation

In Xcode: File → Add Package Dependencies → paste URL:

https://github.com/sparrowcode/DiffableKit

Usage

class 设置Controller: 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
        )
    }
}

关于

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

Topics

Resources

Stars

134 stars

关注者

4 watching

复刻s

发布

贡献者

Languages