Skip to content

Conversation

@jdisho
Copy link

@jdisho jdisho commented Sep 27, 2018

In this PR, I refactor some part of the code.


public class CollectionViewDataSource<CellDeclaration>: NSObject, UICollectionViewDataSource {

// MARK: Public Properties
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I think these kinds of comments are redundant.


// MARK: Init

public init(binderFromDeclaration: @escaping Configurator) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(CellDeclaration) -> CellBinder is short enough and clearer than Configurator.

var idLabel = UILabel(frame: .zero)

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is applied in #13, so please update this branch. Sorry for my late response 🙇

self.configureCell = { cell in
guard let cell = cell as? Cell else {
fatalError("Could not cast UICollectionView cell to \(Cell.self)")
fatalError("Could not cast cell to \(Cell.self)")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants