Created
March 4, 2019 10:18
-
-
Save yukin01/0092bac72d162ae4e86d15c6b53de5ec to your computer and use it in GitHub Desktop.
RxDataSources+SingleSectionModel
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
import Foundation | |
import Differentiator | |
struct SingleSectionModel<ItemType: Equatable> { | |
var items: [ItemType] | |
init(items: [ItemType]) { | |
self.items = items | |
} | |
} | |
extension SingleSectionModel: SectionModelType { | |
init(original: SingleSectionModel<ItemType>, items: [ItemType]) { | |
self.items = items | |
} | |
typealias Item = ItemType | |
} | |
extension SingleSectionModel: Equatable { | |
static func == (lhs: SingleSectionModel<ItemType>, rhs: SingleSectionModel<ItemType>) -> Bool { | |
return lhs.items == rhs.items | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment