RGListKit icon indicating copy to clipboard operation
RGListKit copied to clipboard

Docs for Swift 4 version?

Open bryanbartow opened this issue 6 years ago • 3 comments

Looks like there were breaking changes in the Swift 4 version. Will you update the docs to reflect this? @riteshhgupta

bryanbartow avatar Jul 02 '18 22:07 bryanbartow

Hey @bryanbartow, sure will do by the end of this week but in the meantime the new swift 4 version has two breaking changes on the interface level i.e. ListManager is now called DiffableListViewHolder and ItemModel is now called ListViewItemModel,

new version

...
		let tableView = UITableView()
		let itemModels: [ListViewItemModel] = [...]
		let sectionModel = SectionModel(id: "section-one-id", cells: itemModels)
		
		listManager = DiffableListViewHolder(listView: tableView)
		listManager.sections = [sectionModel]
...

old version

...
		let tableView = UITableView()
		let cellModels: [ItemModel] = [...]
		let sectionModel = SectionModel(id: "section-one-id", cells: cellModels)
		
		listManager = ListManager(listView: tableView)
		listManager.sections = [sectionModel]
...

I have made some internal modifications/improvements but have kept the interface almost same so everything else should be good, if not let me know :)

riteshhgupta avatar Jul 03 '18 05:07 riteshhgupta

@riteshhgupta I'm getting an error that ItemModel is an undeclared type. I'm also getting an error that ItemUI is an undeclared type (protocol).

bryanbartow avatar Jul 03 '18 14:07 bryanbartow

@bryanbartow –– ItemUI has been renamed to ListViewItemModelInjectable & ItemModel has been renamed to ListViewItemModel . Let me know if anything else comes up.

riteshhgupta avatar Jul 04 '18 08:07 riteshhgupta