Skip to content

Commit

Permalink
Refine shortcut extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkawa committed Sep 12, 2018
1 parent 1f72c71 commit 2a3aa73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DataSourceKit/CollectionViewDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class CollectionViewDataSource<CellDeclaration>: NSObject, UICollectionVi
extension CollectionViewDataSource where CellDeclaration == CellBinder {
// Add meaningless parameter to avoid error `Members of constrained extensions
// cannot be declared @objc`, which is caused by collision to init() of NSObject.
public convenience init(_ declarationType: CellDeclaration.Type) {
self.init(binderFromDeclaration: { $0 })
public convenience init(binderFromBinder: @escaping (CellBinder) -> CellBinder = { $0 }) {
self.init(binderFromDeclaration: binderFromBinder)
}
}
4 changes: 2 additions & 2 deletions DataSourceKit/TableViewDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class TableViewDataSource<CellDeclaration>: NSObject, UITableViewDataSour
extension TableViewDataSource where CellDeclaration == CellBinder {
// Add meaningless parameter to avoid error `Members of constrained extensions
// cannot be declared @objc`, which is caused by collision to init() of NSObject.
public convenience init(_ declarationType: CellDeclaration.Type) {
self.init(binderFromDeclaration: { $0 })
public convenience init(binderFromBinder: @escaping (CellBinder) -> CellBinder = { $0 }) {
self.init(binderFromDeclaration: binderFromBinder)
}
}

0 comments on commit 2a3aa73

Please sign in to comment.