Skip to content

Commit

Permalink
Add video cell and ensure and is set for all cell types. Needs testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve228uk committed Jul 3, 2018
1 parent ef44cfd commit 669991a
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ extension MSGMessengerViewController: UICollectionViewDataSource, UICollectionVi
let identifier = message.user.isSender ? "outgoingText" : "incomingText"
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath) as! MSGMessageCell

// TODO: set the delegate here
cell.delegate = self

cell.message = message
cell.style = style
cell.isLastInSection = isLast
Expand All @@ -56,8 +54,9 @@ extension MSGMessengerViewController: UICollectionViewDataSource, UICollectionVi
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath) as! MSGMessageCell

cell.delegate = self

cell.message = message
cell.style = style
cell.isLastInSection = isLast

return cell

Expand All @@ -68,22 +67,33 @@ extension MSGMessengerViewController: UICollectionViewDataSource, UICollectionVi
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath) as! MSGMessageCell

cell.delegate = self

cell.message = message
cell.style = style
cell.isLastInSection = isLast

return cell


case .video:
fatalError("video cell not defined")
break

let identifier = message.user.isSender ? "outgoingVideo" : "incomingVideo"
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath) as! MSGMessageCell

cell.delegate = self
cell.message = message
cell.style = style
cell.isLastInSection = isLast

return cell

case .custom:
let identifier = message.user.isSender ? "outgoingCustom" : "incomingCustom"
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath) as! MSGMessageCell

cell.delegate = self
cell.message = message
cell.style = style
cell.isLastInSection = isLast

return cell
}
Expand Down

0 comments on commit 669991a

Please sign in to comment.