Update FAQ how to hide AvatarView

This commit is contained in:
Jan Weinkauff
2018-05-05 15:12:29 +02:00
parent 488e29b344
commit 8d09cc5c70
+5 -5
View File
@@ -31,13 +31,13 @@ func configureAvatarView(_ avatarView: AvatarView, for message: MessageType, at
}
```
If you return `CGSize.zero` from the `MessagesLayoutDelegate` method
`avatarSize(for:MessageType,at:IndexPath,in:MessagesCollectionView)`, the `AvatarView`
will not be visible for that cell.
If you also like to remove the space the `AvatarView` occupies you have to change the properties
`outgoingAvatarSize` or `incomingAvatarSize` of the `CellSizeCalculator` object for the respective message to `CGSize.zero`.
```Swift
func avatarSize(for: MessageType, at: IndexPath, in: MessagesCollectionView) -> CGSize {
return .zero
if let layout = messagesCollectionView.collectionViewLayout as? MessagesCollectionViewFlowLayout {
layout.textMessageSizeCalculator.outgoingAvatarSize = .zero
layout.textMessageSizeCalculator.incomingAvatarSize = .zero
}
```