Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Asher committed Aug 28, 2018
1 parent 33b13c6 commit 404dbc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Sources/CollectionViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 6 additions & 1 deletion Sources/TableViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 404dbc3

Please sign in to comment.