Skip to content

Commit

Permalink
Merge branch 'feature/cell_preview' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Jul 20, 2016
2 parents e3eb9d0 + 6afe2d0 commit c833fe5
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,16 +422,20 @@ extension ConversationViewController: UICollectionViewDataSource, UICollectionVi

let transitionViews: [UIView?] = mediaMessages.map({
if let index = messages.indexOf($0) {
let cellIndex = index - displayedMessagesRange.location
let cell = conversationCollectionView.cellForItemAtIndexPath(NSIndexPath(forItem: cellIndex, inSection: Section.Message.rawValue))

if let leftImageCell = cell as? ChatLeftImageCell {
return leftImageCell.messageImageView
} else if let rightImageCell = cell as? ChatRightImageCell {
return rightImageCell.messageImageView
if index == messageIndex {
let cellIndex = index - displayedMessagesRange.location
let cell = conversationCollectionView.cellForItemAtIndexPath(NSIndexPath(forItem: cellIndex, inSection: Section.Message.rawValue))

if let leftImageCell = cell as? ChatLeftImageCell {
return leftImageCell.messageImageView
} else if let rightImageCell = cell as? ChatRightImageCell {
return rightImageCell.messageImageView
}
} else {
return nil
}
}

return nil
})

Expand Down

0 comments on commit c833fe5

Please sign in to comment.