Skip to content

Commit

Permalink
rename to lastItemIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
hyouuu authored Feb 18, 2020
1 parent 3dfd26e commit d4f8a46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Views/MessagesCollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ open class MessagesCollectionView: UICollectionView {
guard numberOfSections > 0 else { return }

let lastSection = numberOfSections - 1
let lastItem = numberOfItems(inSection: lastSection) - 1
let lastItemIndex = numberOfItems(inSection: lastSection) - 1

guard lastItem >= 0 else { return }
guard lastItemIndex >= 0 else { return }

let indexPath = IndexPath(row: lastItem, section: lastSection)
let indexPath = IndexPath(row: lastItemIndex, section: lastSection)
scrollToItem(at: indexPath, at: pos, animated: animated)
}

Expand Down

0 comments on commit d4f8a46

Please sign in to comment.