From 404dbc36012d474e78eb915ed17138844a42e3af Mon Sep 17 00:00:00 2001 From: Ben Asher Date: Mon, 27 Aug 2018 16:17:25 -0700 Subject: [PATCH] comments --- Sources/CollectionViewModel.swift | 6 +++++- Sources/TableViewModel.swift | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Sources/CollectionViewModel.swift b/Sources/CollectionViewModel.swift index c3e0a54..71e0f25 100644 --- a/Sources/CollectionViewModel.swift +++ b/Sources/CollectionViewModel.swift @@ -168,20 +168,24 @@ public struct CollectionSectionViewModel: DiffableViewModel { } } -/// Collection support for diffing +/// `Collection` support for diffing extension CollectionSectionViewModel: Collection { + /// :nodoc: public subscript(position: Int) -> CollectionCellViewModel { return self.cellViewModels[position] } + /// :nodoc: public func index(after i: Int) -> Int { return self.cellViewModels.index(after: i) } + /// :nodoc: public var startIndex: Int { return self.cellViewModels.startIndex } + /// :nodoc: public var endIndex: Int { return self.cellViewModels.endIndex } diff --git a/Sources/TableViewModel.swift b/Sources/TableViewModel.swift index 5730a0c..ec5dc98 100644 --- a/Sources/TableViewModel.swift +++ b/Sources/TableViewModel.swift @@ -181,20 +181,25 @@ public struct TableSectionViewModel: DiffableViewModel { } } -/// Collection support for diffing +/// `Collection` support for diffing extension TableSectionViewModel: Collection { + + /// :nodoc: public subscript(position: Int) -> TableCellViewModel { return self.cellViewModels[position] } + /// :nodoc: public func index(after i: Int) -> Int { return self.cellViewModels.index(after: i) } + /// :nodoc: public var startIndex: Int { return self.cellViewModels.startIndex } + /// :nodoc: public var endIndex: Int { return self.cellViewModels.endIndex }