-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
205 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
DataSourceKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
DataSourceKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// C.swift | ||
// DataSourceKitTests | ||
// | ||
// Created by zhzh liu on 2018/9/10. | ||
// Copyright © 2018年 Yosuke Ishikawa. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct C { | ||
let id: Int64 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// CCollectionViewCell.swift | ||
// DataSourceKitTests | ||
// | ||
// Created by zhzh liu on 2018/9/10. | ||
// Copyright © 2018年 Yosuke Ishikawa. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import DataSourceKit | ||
|
||
class CCollectionViewCell: UICollectionViewCell { | ||
var idLabel = UILabel(frame: .zero) | ||
} | ||
|
||
extension CCollectionViewCell: BindableCell { | ||
static func makeBinder(value: C) -> CellBinder { | ||
return CellBinder( | ||
cellType: CCollectionViewCell.self, | ||
registrationMethod: .class(CCollectionViewCell.self), | ||
reuseIdentifier: "CCollectionViewCell", | ||
configureCell: { (cell) in | ||
cell.idLabel.text = "\(value.id)" | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// CTableViewCell.swift | ||
// DataSourceKitTests | ||
// | ||
// Created by zhzh liu on 2018/9/10. | ||
// Copyright © 2018年 Yosuke Ishikawa. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import DataSourceKit | ||
|
||
class CTableViewCell: UITableViewCell { | ||
var idLabel = UILabel(frame: .zero) | ||
|
||
override init(style: UITableViewCellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
contentView.addSubview(idLabel) | ||
idLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor) | ||
idLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor) | ||
idLabel.heightAnchor.constraint(equalToConstant: 44.0) | ||
idLabel.topAnchor.constraint(equalTo: contentView.topAnchor) | ||
idLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor) | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError() | ||
} | ||
} | ||
|
||
extension CTableViewCell: BindableCell { | ||
static func makeBinder(value: C) -> CellBinder { | ||
return CellBinder( | ||
cellType: CTableViewCell.self, | ||
registrationMethod: .class(CTableViewCell.self), | ||
reuseIdentifier: "CTableViewCell", | ||
configureCell: { (cell) in | ||
cell.idLabel.text = "\(value.id)" | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.