diff --git a/CHANGELOG.md b/CHANGELOG.md index 3debc9fc..8fcbd898 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,15 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Fixed -+- **Breaking Change** Fixed all instances of misspelled `inital` property. `Avatar.inital` has changed to `Avatar.initial` +- **Breaking Change** Fixed all instances of misspelled `inital` property. `Avatar.inital` has changed to `Avatar.initial` and the initializer has changed from `public init(image: UIImage? = nil, initals: String = "?")` to `public init(image: UIImage? = nil, initials: String = "?")`. [#298](https://github.com/MessageKit/MessageKit/issues/298) by [@sidmclaughlin](https://github.com/sidmclaughlin). +- Fixed `cellbottomLabel` origin X for the `.messageLeading` alignment and +origin Y so that the `cellBottomLabel` is always under the `MessageContainerView`. +[#326](https://github.com/MessageKit/MessageKit/pull/326) by [@SD10](https://github.com/sd10). + + ## [[Prerelease] 0.10.1](https://github.com/MessageKit/MessageKit/releases/tag/0.10.1) ### Fixed diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 9a6cd95e..150ea00f 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - MessageKit (0.10.0) + - MessageKit (0.10.1) DEPENDENCIES: - MessageKit (from `../MessageKit.podspec`) @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: ../MessageKit.podspec SPEC CHECKSUMS: - MessageKit: dc900db857e89ac994f1afeb1080539de7fabde4 + MessageKit: b0cd905fa1872952f25ff5ea8e67d7135fe7e176 PODFILE CHECKSUM: 9ac65b8dedf0e1b63fea245b089b6645c4e66309 diff --git a/Example/Sources/ConversationViewController.swift b/Example/Sources/ConversationViewController.swift index 39c3fe5c..573c421f 100644 --- a/Example/Sources/ConversationViewController.swift +++ b/Example/Sources/ConversationViewController.swift @@ -64,6 +64,7 @@ class ConversationViewController: MessagesViewController { @objc func handleKeyboardButton() { + messageInputBar.inputTextView.resignFirstResponder() let actionSheetController = UIAlertController(title: "Change Keyboard Style", message: nil, preferredStyle: .actionSheet) let actions = [ UIAlertAction(title: "Slack", style: .default, handler: { _ in @@ -172,7 +173,6 @@ class ConversationViewController: MessagesViewController { } func defaultStyle() { - messageInputBar.inputTextView.resignFirstResponder() let newMessageInputBar = MessageInputBar() newMessageInputBar.sendButton.tintColor = UIColor(red: 69/255, green: 193/255, blue: 89/255, alpha: 1) newMessageInputBar.delegate = self diff --git a/Sources/Layout/MessagesCollectionViewFlowLayout.swift b/Sources/Layout/MessagesCollectionViewFlowLayout.swift index 7010597a..717ed15d 100644 --- a/Sources/Layout/MessagesCollectionViewFlowLayout.swift +++ b/Sources/Layout/MessagesCollectionViewFlowLayout.swift @@ -780,7 +780,7 @@ fileprivate extension MessagesCollectionViewFlowLayout { guard attributes.cellBottomLabelSize != .zero else { return .zero } - var origin = CGPoint(x: 0, y: contentFrame.height - attributes.cellBottomLabelSize.height) + var origin = CGPoint(x: 0, y: attributes.cellTopLabelSize.height + attributes.messageContainerSize.height + attributes.messageVerticalPadding) switch (attributes.cellBottomLabelAlignment, attributes.avatarHorizontal) { case (.cellLeading, _): @@ -792,7 +792,7 @@ fileprivate extension MessagesCollectionViewFlowLayout { case (.messageLeading, .cellLeading): origin.x = attributes.avatarSize.width + attributes.messageContainerPadding.left case (.messageLeading, .cellTrailing): - origin.x = contentFrame.width - attributes.avatarSize.width - attributes.messageContainerPadding.right - attributes.cellBottomLabelSize.width + origin.x = contentFrame.width - attributes.avatarSize.width - attributes.messageContainerPadding.right - attributes.messageContainerSize.width case (.messageTrailing, .cellTrailing): origin.x = contentFrame.width - attributes.avatarSize.width - attributes.messageContainerPadding.right - attributes.cellBottomLabelSize.width case (.messageTrailing, .cellLeading):