mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Changelog and some comments
This commit is contained in:
@@ -22,6 +22,9 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
|
||||
- Added `additionalBottomInset` property that allows to adjust the bottom content inset automatically set on the messages collection view by the view controller.
|
||||
[#787](https://github.com/MessageKit/MessageKit/pull/787) by [@andreyvit](https://github.com/andreyvit)
|
||||
|
||||
- Added new methods to simplify using of custom messages: `customCellSizeCalculator(for:at:in:)` for `MessagesLayoutDelegate` and `customCell(for:at:in:)` for `MessagesDataSource`.
|
||||
[#879](https://github.com/MessageKit/MessageKit/pull/879) by [@realbonus](https://github.com/RealBonus)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed bottom content inset adjustment when using an undocked keyboard on iPad, or when `edgesForExtendedLayout` does not include `.top`, or when a parent container view controller adds extra views at the top of the screen.
|
||||
|
||||
@@ -180,6 +180,8 @@ UICollectionViewDelegateFlowLayout, UICollectionViewDataSource {
|
||||
return collectionView.messagesDataSource?.numberOfItems(inSection: section, in: collectionView) ?? 0
|
||||
}
|
||||
|
||||
/// Note:
|
||||
/// If you override this method, remember to call MessagesDataSource's customCell(for:at:in:) for MessageKind.custom messages, if necessary
|
||||
open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
|
||||
guard let messagesCollectionView = collectionView as? MessagesCollectionView else {
|
||||
|
||||
@@ -135,6 +135,8 @@ open class MessagesCollectionViewFlowLayout: UICollectionViewFlowLayout {
|
||||
lazy open var videoMessageSizeCalculator = MediaMessageSizeCalculator(layout: self)
|
||||
lazy open var locationMessageSizeCalculator = LocationMessageSizeCalculator(layout: self)
|
||||
|
||||
/// - Note:
|
||||
/// If you override this method, remember to call MessageLayoutDelegate's customCellSizeCalculator(for:at:in:) method for MessageKind.custom messages, if necessary
|
||||
open func cellSizeCalculatorForItem(at indexPath: IndexPath) -> CellSizeCalculator {
|
||||
let message = messagesDataSource.messageForItem(at: indexPath, in: messagesCollectionView)
|
||||
switch message.kind {
|
||||
|
||||
Reference in New Issue
Block a user