Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>SchemeUserState</key>
<dict>
<key>RSMasterTableViewKit.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import UIKit

/// UITableViewCellConfiguration
public typealias UITableViewCellConfiguration<T> = ((_ cell: UITableViewCell, _ dataObject: T, _ indexPath: IndexPath) -> ())
public typealias UITableViewCellConfiguration<Cell: UITableViewCell, T> = ((_ cell: Cell, _ dataObject: T, _ indexPath: IndexPath) -> ())

/// Reusable TableViewCell
public protocol Reusable: class {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protocol RSTableViewDataSourceUpdate: class {
}

/// RSTableViewDataSource
open class RSTableViewDataSource<T>: NSObject, UITableViewDataSource {
open class RSTableViewDataSource<Cell: UITableViewCell, T>: NSObject, UITableViewDataSource {

// MARK: - Properties

Expand Down Expand Up @@ -96,7 +96,7 @@ open class RSTableViewDataSource<T>: NSObject, UITableViewDataSource {
private weak var dataSourceUpdateDelegate: RSTableViewDataSourceUpdate?

/// cell configuration - (cell, dataObject, indexPath)
private var cellConfiguration: UITableViewCellConfiguration<T>?
private var cellConfiguration: UITableViewCellConfiguration<Cell, T>?

/// cell identifier
private var cellIdentifier: String!
Expand All @@ -107,7 +107,7 @@ open class RSTableViewDataSource<T>: NSObject, UITableViewDataSource {

// MARK: - Initialize

public init(tableView: RSTableView, identifier: String, cellConfiguration: @escaping UITableViewCellConfiguration<T>) {
public init(tableView: RSTableView, identifier: String, cellConfiguration: @escaping UITableViewCellConfiguration<Cell, T>) {
super.init()

tableView.dataSource = self
Expand All @@ -128,7 +128,7 @@ open class RSTableViewDataSource<T>: NSObject, UITableViewDataSource {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

// deque tableview cell
let cell = tableView.dequeueReusableCell(withIdentifier: self.cellIdentifier, for: indexPath)
let cell = tableView.dequeueReusableCell(withIdentifier: self.cellIdentifier, for: indexPath) as! Cell

// cell configuration
if let config = cellConfiguration {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>SchemeUserState</key>
<dict>
<key>RSMasterTableViewKitExample.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>