Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Add optional table view data source methods #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ivanruizscm
Copy link
Contributor

Problem
If you customize a BothamTableViewDataSource theres no optional methods from UITableViewDataSource like canEditRow:indexPath.
So subclassing it don't give you access to them:

var dataSource: BothamTableViewDataSource<ModelType, CellType>!
dataSource = CustomBothamTableViewDataSource()
class CustomBothamTableViewDataSource: BothamTableViewDataSource<ModelType, CellType> {
    //You can override this
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> { }

   //But not this
   func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { }
}

Cause BothamTableViewDatasource just implements the required methods in the protocol. So i added the default behaviour.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant