Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor/refactoring 🖖 #12

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

Conversation

jdisho
Copy link

@jdisho jdisho commented Sep 27, 2018

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

@@ -9,15 +9,25 @@
import UIKit

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.

@@ -12,7 +12,7 @@ import DataSourceKit
class CTableViewCell: UITableViewCell {
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 🙇

@@ -26,7 +26,7 @@ public struct CellBinder {
self.reuseIdentifier = reuseIdentifier
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