From 47002599708734e956c9affd421855a2682a4c70 Mon Sep 17 00:00:00 2001 From: Jurvis Tan Date: Fri, 8 Jan 2021 14:56:00 +0800 Subject: [PATCH 01/22] fix: remove unwanted bottom scroll indicator inset --- Sources/Controllers/MessagesViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Controllers/MessagesViewController.swift b/Sources/Controllers/MessagesViewController.swift index 0441c24c..197175e3 100644 --- a/Sources/Controllers/MessagesViewController.swift +++ b/Sources/Controllers/MessagesViewController.swift @@ -227,6 +227,9 @@ UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, UIGestureRecogni messagesCollectionView.keyboardDismissMode = .interactive messagesCollectionView.alwaysBounceVertical = true messagesCollectionView.backgroundColor = .collectionViewBackground + if #available(iOS 13.0, *) { + messagesCollectionView.automaticallyAdjustsScrollIndicatorInsets = false + } } private func setupDelegates() { From 7189e5a1af50160884bc6a5f9bdf9cb250dc139a Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Wed, 13 Jan 2021 18:39:04 +0100 Subject: [PATCH 02/22] Prepare 3.5.0 release --- CHANGELOG.md | 10 ++++++++++ Gemfile | 2 +- Gemfile.lock | 10 +++++----- MessageKit.podspec | 2 +- Package.swift | 2 +- README.md | 2 ++ 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c4f8068..5f755ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Fixed +### Added + +### Changed + +### Removed + +## 3.5.0 + +### Fixed + - maintainPositionOnKeyboardFrameChanged for small contentSize would scroll content out of bounds [#1506](https://github.com/MessageKit/MessageKit/pull/1506) by [@martinpucik](https://github.com/martinpucik) ### Added diff --git a/Gemfile b/Gemfile index ce1c92bd..f2e566d0 100644 --- a/Gemfile +++ b/Gemfile @@ -23,4 +23,4 @@ source 'https://rubygems.org' gem 'danger', '~> 6.2' -gem 'danger-swiftlint', '~> 0.24' \ No newline at end of file +gem 'danger-swiftlint', '~> 0.24' diff --git a/Gemfile.lock b/Gemfile.lock index 2490ff95..1c3aa84d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,7 +24,7 @@ GEM no_proxy_fix octokit (~> 4.7) terminal-table (~> 1) - danger-swiftlint (0.24.3) + danger-swiftlint (0.24.5) danger rake (> 10) thor (~> 0.19) @@ -32,7 +32,7 @@ GEM multipart-post (>= 1.2, < 3) faraday-http-cache (2.2.0) faraday (>= 0.8) - git (1.7.0) + git (1.8.1) rchardet (~> 1.8) kramdown (2.3.0) rexml @@ -41,12 +41,12 @@ GEM multipart-post (2.1.1) nap (1.1.0) no_proxy_fix (0.1.2) - octokit (4.18.0) + octokit (4.20.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) open4 (1.3.4) - public_suffix (4.0.5) - rake (13.0.1) + public_suffix (4.0.6) + rake (13.0.3) rchardet (1.8.0) rexml (3.2.4) sawyer (0.8.2) diff --git a/MessageKit.podspec b/MessageKit.podspec index 844e3cc9..76dff8c0 100644 --- a/MessageKit.podspec +++ b/MessageKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MessageKit' - s.version = '3.4.2' + s.version = '3.5.0' s.license = { :type => "MIT", :file => "LICENSE.md" } s.summary = 'An elegant messages UI library for iOS.' diff --git a/Package.swift b/Package.swift index 77893b6a..cf116a2b 100644 --- a/Package.swift +++ b/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "MessageKit", targets: ["MessageKit"]), ], dependencies: [ - .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.2.1")) + .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.2.2")) ], targets: [ .target( diff --git a/README.md b/README.md index 83f57a83..f5f8bef5 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,8 @@ _Please provide attribution, it is greatly appreciated._ - [@nathantannar4](https://github.com/nathantannar4), Nathan Tannar - [@zhongwuzw](https://github.com/zhongwuzw), Wu Zhong - [@austinwright](https://github.com/austinwright), Austin Wright +- [@kaspik](https://github.com/kaspik), Jakub Kaspar +- [@martinpucik](https://github.com/martinpucik), Martin Pucik ## Thanks From c49b53d774741f425a8f9507bd9ecd68a6bdcb2c Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Thu, 14 Jan 2021 13:49:06 +0100 Subject: [PATCH 03/22] Remove Carthage mention as it's no longer supported --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index f5f8bef5..6bf11445 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ [![Danger](https://github.com/MessageKit/MessageKit/workflows/Danger/badge.svg)](https://github.com/MessageKit/MessageKit/actions?query=workflow%3A%22Danger%22) [![codecov](https://codecov.io/gh/MessageKit/MessageKit/branch/master/graph/badge.svg)](https://codecov.io/gh/MessageKit/MessageKit) -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) Swift @@ -66,14 +65,6 @@ pod 'MessageKit', '~> 3.3.0' pod 'MessageKit', '~> 3.0.0' ``` -### [Carthage](https://github.com/Carthage/Carthage) - -To integrate MessageKit using Carthage, add the following to your `Cartfile`: - -``` -github "MessageKit/MessageKit" -``` - ### [Swift Package Manager](https://swift.org/package-manager/) Swift 5.3 in Xcode 12 [added support](https://github.com/apple/swift-evolution/blob/master/proposals/0271-package-manager-resources.md) for assets in Swift Packages. From 9a97f5a06b8f5474a77cafd8fa87ce0f7bee80f2 Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Thu, 14 Jan 2021 13:51:54 +0100 Subject: [PATCH 04/22] Remove Cartfile --- Cartfile | 1 - Cartfile.resolved | 3 --- 2 files changed, 4 deletions(-) delete mode 100644 Cartfile delete mode 100644 Cartfile.resolved diff --git a/Cartfile b/Cartfile deleted file mode 100644 index 57a16b44..00000000 --- a/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "nathantannar4/InputBarAccessoryView" ~> 5.2.1 diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index b553a159..00000000 --- a/Cartfile.resolved +++ /dev/null @@ -1,3 +0,0 @@ -github "Quick/Nimble" "v8.1.2" -github "Quick/Quick" "v2.2.1" -github "nathantannar4/InputBarAccessoryView" "5.2.1" From 3606867c9b8456211292e8bcf03e10d27db8c5cb Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Thu, 14 Jan 2021 13:53:49 +0100 Subject: [PATCH 05/22] Update IBAV --- MessageKit.podspec | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MessageKit.podspec b/MessageKit.podspec index 76dff8c0..2db40860 100644 --- a/MessageKit.podspec +++ b/MessageKit.podspec @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '12.0' s.ios.resource_bundle = { 'MessageKit' => 'Sources/Assets.xcassets' } - s.dependency 'InputBarAccessoryView', '~> 5.2.1' + s.dependency 'InputBarAccessoryView', '~> 5.2.3' end diff --git a/Package.swift b/Package.swift index cf116a2b..45eec47a 100644 --- a/Package.swift +++ b/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "MessageKit", targets: ["MessageKit"]), ], dependencies: [ - .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.2.2")) + .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.2.3")) ], targets: [ .target( From bb6fe2ca95edb38dda83662e8d29ab5b56cd8248 Mon Sep 17 00:00:00 2001 From: Matthew Knippen Date: Thu, 14 Jan 2021 16:39:40 -0600 Subject: [PATCH 06/22] added Charge Running as an app using this library --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6bf11445..dd1e7846 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ Add your app to the list of apps using this library and make a pull request. - [SmooveText](https://apps.apple.com/np/app/smoove-text/id1362792811) - [COYO Engage](https://apps.apple.com/app/coyo-engage/id1341588804) - [HitchPin](https://www.hitchpin.com) +- [Charge Running](https://www.chargerunning.com) _Please provide attribution, it is greatly appreciated._ From 66afde080d7b9a81c12780465ce6d243136e9704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ka=C5=A1par?= Date: Thu, 14 Jan 2021 23:44:47 +0100 Subject: [PATCH 07/22] Change link to AppStore --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd1e7846..e11e4dcc 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ Add your app to the list of apps using this library and make a pull request. - [SmooveText](https://apps.apple.com/np/app/smoove-text/id1362792811) - [COYO Engage](https://apps.apple.com/app/coyo-engage/id1341588804) - [HitchPin](https://www.hitchpin.com) -- [Charge Running](https://www.chargerunning.com) +- [Charge Running](https://apps.apple.com/app/charge-running-live-coaching/id1204578360) _Please provide attribution, it is greatly appreciated._ From eca45b11d2394139bb43fcf37e981c859b4b2a42 Mon Sep 17 00:00:00 2001 From: Angus Cheng Date: Mon, 8 Feb 2021 12:13:50 +0800 Subject: [PATCH 08/22] Update QuickStart.md --- Documentation/QuickStart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/QuickStart.md b/Documentation/QuickStart.md index 5d877594..89dd180f 100644 --- a/Documentation/QuickStart.md +++ b/Documentation/QuickStart.md @@ -100,13 +100,13 @@ public struct Sender: SenderType { } // Some global variables for the sake of the example. Using globals is not recommended! -let sender = Sender(id: "any_unique_id", displayName: "Steven") +let sender = Sender(senderId: "any_unique_id", displayName: "Steven") let messages: [MessageType] = [] extension ChatViewController: MessagesDataSource { func currentSender() -> SenderType { - return Sender(id: "any_unique_id", displayName: "Steven") + return Sender(senderId: "any_unique_id", displayName: "Steven") } func numberOfSections(in messagesCollectionView: MessagesCollectionView) -> Int { From c6cec43ad8c5299e0e23545f4a84fdb88332a883 Mon Sep 17 00:00:00 2001 From: Morgan Dock Date: Tue, 2 Mar 2021 19:47:01 -0800 Subject: [PATCH 09/22] Add new App that uses this library --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e11e4dcc..6d80fb13 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ Add your app to the list of apps using this library and make a pull request. - [COYO Engage](https://apps.apple.com/app/coyo-engage/id1341588804) - [HitchPin](https://www.hitchpin.com) - [Charge Running](https://apps.apple.com/app/charge-running-live-coaching/id1204578360) +- [HER](https://apps.apple.com/us/app/id573328837) _Please provide attribution, it is greatly appreciated._ From af2ebb079458796a57d63df23c02d1a711741500 Mon Sep 17 00:00:00 2001 From: Michael Redig Date: Wed, 3 Mar 2021 19:49:39 -0600 Subject: [PATCH 10/22] (fix) Resolves #1531 chat messages don't suddenly disappear under translucent navigation bar headers --- Sources/Controllers/MessagesViewController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/Controllers/MessagesViewController.swift b/Sources/Controllers/MessagesViewController.swift index 197175e3..f9c4d5c5 100644 --- a/Sources/Controllers/MessagesViewController.swift +++ b/Sources/Controllers/MessagesViewController.swift @@ -223,7 +223,6 @@ UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, UIGestureRecogni private func setupDefaults() { extendedLayoutIncludesOpaqueBars = true view.backgroundColor = .collectionViewBackground - messagesCollectionView.contentInsetAdjustmentBehavior = .never messagesCollectionView.keyboardDismissMode = .interactive messagesCollectionView.alwaysBounceVertical = true messagesCollectionView.backgroundColor = .collectionViewBackground @@ -244,7 +243,7 @@ UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, UIGestureRecogni private func setupConstraints() { messagesCollectionView.translatesAutoresizingMaskIntoConstraints = false - let top = messagesCollectionView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor) + let top = messagesCollectionView.topAnchor.constraint(equalTo: view.topAnchor) let bottom = messagesCollectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor) let leading = messagesCollectionView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor) let trailing = messagesCollectionView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor) From 3b3763c3f49c246f7ef7cbd3dc4a0afd56ed1ec1 Mon Sep 17 00:00:00 2001 From: Michael Redig Date: Thu, 4 Mar 2021 22:00:06 -0600 Subject: [PATCH 11/22] (nit) updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f755ea7..bf6af122 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ## Future release ### Fixed +- `MessagesViewController` now smoothly scrolls messages off screen. [1531](https://github.com/MessageKit/MessageKit/issues/1531) & [1547](https://github.com/MessageKit/MessageKit/pull/1547) by [@mredig](https://github.com/mredig) ### Added From 1775eab9a1ffe9708cb3e249fc782d744c3048ea Mon Sep 17 00:00:00 2001 From: Angus Cheng Date: Fri, 5 Mar 2021 14:58:53 +0800 Subject: [PATCH 12/22] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6d80fb13..a9109f5b 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,7 @@ Add your app to the list of apps using this library and make a pull request. - [HitchPin](https://www.hitchpin.com) - [Charge Running](https://apps.apple.com/app/charge-running-live-coaching/id1204578360) - [HER](https://apps.apple.com/us/app/id573328837) +- [Girlfriend Plus](https://apps.apple.com/us/app/girlfriend-plus/id1011637655) _Please provide attribution, it is greatly appreciated._ From 4e97e02d85a69a8af609b6861a8d176c4387aaea Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Mon, 8 Mar 2021 11:44:20 +0100 Subject: [PATCH 13/22] Prepare release --- CHANGELOG.md | 9 ++++++++- Gemfile.lock | 2 +- MessageKit.podspec | 4 ++-- Package.swift | 2 +- .../Controllers Test/MessagesViewControllerTests.swift | 1 - 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6af122..724dab33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ## Future release ### Fixed -- `MessagesViewController` now smoothly scrolls messages off screen. [1531](https://github.com/MessageKit/MessageKit/issues/1531) & [1547](https://github.com/MessageKit/MessageKit/pull/1547) by [@mredig](https://github.com/mredig) ### Added @@ -13,6 +12,14 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Removed +## 3.5.1 + +### Fixed +- `MessagesViewController` now smoothly scrolls messages off screen. [1531](https://github.com/MessageKit/MessageKit/issues/1531) & [1547](https://github.com/MessageKit/MessageKit/pull/1547) by [@mredig](https://github.com/mredig) + +### Changed +- Bump `InputBarAccessoryView` + ## 3.5.0 ### Fixed diff --git a/Gemfile.lock b/Gemfile.lock index 1c3aa84d..bc5964d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,7 +28,7 @@ GEM danger rake (> 10) thor (~> 0.19) - faraday (0.17.3) + faraday (0.17.4) multipart-post (>= 1.2, < 3) faraday-http-cache (2.2.0) faraday (>= 0.8) diff --git a/MessageKit.podspec b/MessageKit.podspec index 2db40860..35fdfe81 100644 --- a/MessageKit.podspec +++ b/MessageKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MessageKit' - s.version = '3.5.0' + s.version = '3.5.1' s.license = { :type => "MIT", :file => "LICENSE.md" } s.summary = 'An elegant messages UI library for iOS.' @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '12.0' s.ios.resource_bundle = { 'MessageKit' => 'Sources/Assets.xcassets' } - s.dependency 'InputBarAccessoryView', '~> 5.2.3' + s.dependency 'InputBarAccessoryView', '~> 5.3.0' end diff --git a/Package.swift b/Package.swift index 45eec47a..eaf578e2 100644 --- a/Package.swift +++ b/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "MessageKit", targets: ["MessageKit"]), ], dependencies: [ - .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.2.3")) + .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.3.0")) ], targets: [ .target( diff --git a/Tests/MessageKitTests/Controllers Test/MessagesViewControllerTests.swift b/Tests/MessageKitTests/Controllers Test/MessagesViewControllerTests.swift index 9417eb26..49132706 100644 --- a/Tests/MessageKitTests/Controllers Test/MessagesViewControllerTests.swift +++ b/Tests/MessageKitTests/Controllers Test/MessagesViewControllerTests.swift @@ -232,7 +232,6 @@ final class MessagesViewControllerTests: XCTestCase { func testDefaultPropertyValues() { let controller = MessagesViewController() - XCTAssertFalse(controller.scrollsToBottomOnKeyboardBeginsEditing) XCTAssertTrue(controller.canBecomeFirstResponder) XCTAssertFalse(controller.shouldAutorotate) XCTAssertNotNil(controller.inputAccessoryView) From ba61f6e74fd21020e09428ea553b5d51ea11f9d0 Mon Sep 17 00:00:00 2001 From: Anton Karpechenkov Date: Sat, 13 Mar 2021 20:52:15 +0100 Subject: [PATCH 14/22] updated target bottom offset of collection view despite the contentSize is smaller than viewport --- Sources/Controllers/MessagesViewController+Keyboard.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Controllers/MessagesViewController+Keyboard.swift b/Sources/Controllers/MessagesViewController+Keyboard.swift index 8511c0f6..59e0926e 100644 --- a/Sources/Controllers/MessagesViewController+Keyboard.swift +++ b/Sources/Controllers/MessagesViewController+Keyboard.swift @@ -98,6 +98,10 @@ internal extension MessagesViewController { let newBottomInset = requiredScrollViewBottomInset(forKeyboardFrame: keyboardEndFrame) let differenceOfBottomInset = newBottomInset - messageCollectionViewBottomInset + UIView.performWithoutAnimation { + messageCollectionViewBottomInset = newBottomInset + } + if maintainPositionOnKeyboardFrameChanged && differenceOfBottomInset != 0 { let contentOffset = CGPoint(x: messagesCollectionView.contentOffset.x, y: messagesCollectionView.contentOffset.y + differenceOfBottomInset) // Changing contentOffset to bigger number than the contentSize will result in a jump of content @@ -107,10 +111,6 @@ internal extension MessagesViewController { } messagesCollectionView.setContentOffset(contentOffset, animated: false) } - - UIView.performWithoutAnimation { - messageCollectionViewBottomInset = newBottomInset - } } // MARK: - Inset Computation From cfa8b2e370e620adc316d51aa280e5668de0fd03 Mon Sep 17 00:00:00 2001 From: Anton Karpechenkov Date: Sat, 13 Mar 2021 21:39:20 +0100 Subject: [PATCH 15/22] updated changelog for #1529 fix --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 724dab33..990ff2b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Fixed +- Fixes an issue with Scroll problem on new messages with keyboard open [#1529](https://github.com/MessageKit/MessageKit/pull/1529) by [@politan8](https://github.com/politan8) + ### Added ### Changed From c5cdd11c596717cc7e238eb6357745fa9eb7d7e1 Mon Sep 17 00:00:00 2001 From: Kurt Schaefer Date: Tue, 16 Mar 2021 16:48:28 -0700 Subject: [PATCH 16/22] Make messageTimestampLabel layout out relative to the messageContainerView so its vertical position tracks much better with the content of the message. --- Sources/Views/Cells/MessageContentCell.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Views/Cells/MessageContentCell.swift b/Sources/Views/Cells/MessageContentCell.swift index bb881add..618d0eae 100644 --- a/Sources/Views/Cells/MessageContentCell.swift +++ b/Sources/Views/Cells/MessageContentCell.swift @@ -357,7 +357,8 @@ open class MessageContentCell: MessageCollectionViewCell { /// - attributes: The `MessagesCollectionViewLayoutAttributes` for the cell. open func layoutTimeLabelView(with attributes: MessagesCollectionViewLayoutAttributes) { let paddingLeft: CGFloat = 10 - let origin = CGPoint(x: UIScreen.main.bounds.width + paddingLeft, y: contentView.frame.size.height * 0.5) + let origin = CGPoint(x: UIScreen.main.bounds.width + paddingLeft, + y: messageContainerView.frame.minY + messageContainerView.frame.height * 0.5 - messageTimestampLabel.font.ascender * 0.5) let size = CGSize(width: attributes.messageTimeLabelSize.width, height: attributes.messageTimeLabelSize.height) messageTimestampLabel.frame = CGRect(origin: origin, size: size) } From 6e6f42b1e7ebf7da92444a29414acfb5f1075f4d Mon Sep 17 00:00:00 2001 From: Kurt Schaefer Date: Wed, 17 Mar 2021 09:39:17 -0700 Subject: [PATCH 17/22] Update change log to include info about my time stamp alignment fix. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 990ff2b5..adbf5ee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa - Fixes an issue with Scroll problem on new messages with keyboard open [#1529](https://github.com/MessageKit/MessageKit/pull/1529) by [@politan8](https://github.com/politan8) +- Fixes time stamp vertical alignment so labels align with messages when showMessageTimestampOnSwipeLeft is true. + by [@kurtsequoia](https://github.com/MessageKit/MessageKit/pull/1556) + ### Added ### Changed From 990b9683d4d49073474a4004e3091343522706d0 Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Thu, 25 Mar 2021 11:22:52 +0100 Subject: [PATCH 18/22] Update bundler --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index bc5964d3..62e89c6a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,7 +34,7 @@ GEM faraday (>= 0.8) git (1.8.1) rchardet (~> 1.8) - kramdown (2.3.0) + kramdown (2.3.1) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) From 793dce689484cd83d804d9fe2726c46091f5af90 Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Thu, 25 Mar 2021 11:37:52 +0100 Subject: [PATCH 19/22] Fix typing indicator calulator based on delegate methods --- .../Layout/TypingIndicatorCellSizeCalculator.swift | 9 ++------- Sources/Protocols/MessagesLayoutDelegate.swift | 14 ++++++++------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Sources/Layout/TypingIndicatorCellSizeCalculator.swift b/Sources/Layout/TypingIndicatorCellSizeCalculator.swift index 3e77663f..551465da 100644 --- a/Sources/Layout/TypingIndicatorCellSizeCalculator.swift +++ b/Sources/Layout/TypingIndicatorCellSizeCalculator.swift @@ -26,18 +26,13 @@ import UIKit open class TypingCellSizeCalculator: CellSizeCalculator { - open var height: CGFloat = 62 - public init(layout: MessagesCollectionViewFlowLayout? = nil) { super.init() self.layout = layout } open override func sizeForItem(at indexPath: IndexPath) -> CGSize { - guard let layout = layout else { return .zero } - let collectionViewWidth = layout.collectionView?.bounds.width ?? 0 - let contentInset = layout.collectionView?.contentInset ?? .zero - let inset = layout.sectionInset.horizontal + contentInset.horizontal - return CGSize(width: collectionViewWidth - inset, height: height) + guard let layout = layout as? MessagesCollectionViewFlowLayout else { return .zero } + return layout.messagesLayoutDelegate.typingIndicatorViewSize(for: layout) } } diff --git a/Sources/Protocols/MessagesLayoutDelegate.swift b/Sources/Protocols/MessagesLayoutDelegate.swift index 0e0238bb..a3d9ff5a 100644 --- a/Sources/Protocols/MessagesLayoutDelegate.swift +++ b/Sources/Protocols/MessagesLayoutDelegate.swift @@ -52,12 +52,11 @@ public protocol MessagesLayoutDelegate: AnyObject { /// Specifies the size to use for a typing indicator view. /// /// - Parameters: - /// - messagesCollectionView: The `MessagesCollectionView` in which this view will be displayed. + /// - layout: The `MessagesCollectionViewFlowLayout` layout. /// /// - Note: - /// The default value returned by this method is the width of the `messagesCollectionView` and - /// a height of 52. - func typingIndicatorViewSize(in messagesCollectionView: MessagesCollectionView) -> CGSize + /// The default value returned by this method is the width of the `messagesCollectionView` minus insets and a height of 62. + func typingIndicatorViewSize(for layout: MessagesCollectionViewFlowLayout) -> CGSize /// Specifies the top inset to use for a typing indicator view. /// @@ -134,8 +133,11 @@ public extension MessagesLayoutDelegate { return .zero } - func typingIndicatorViewSize(in messagesCollectionView: MessagesCollectionView) -> CGSize { - return CGSize(width: messagesCollectionView.bounds.width, height: 48) + func typingIndicatorViewSize(for layout: MessagesCollectionViewFlowLayout) -> CGSize { + let collectionViewWidth = layout.messagesCollectionView.bounds.width + let contentInset = layout.messagesCollectionView.contentInset + let inset = layout.sectionInset.horizontal + contentInset.horizontal + return CGSize(width: collectionViewWidth - inset, height: 62) } func typingIndicatorViewTopInset(in messagesCollectionView: MessagesCollectionView) -> CGFloat { From 9f7ef8949b6d908d8bd7056a89e43e0b49d622e6 Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Thu, 25 Mar 2021 11:55:54 +0100 Subject: [PATCH 20/22] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index adbf5ee7..87442180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa - Fixes time stamp vertical alignment so labels align with messages when showMessageTimestampOnSwipeLeft is true. by [@kurtsequoia](https://github.com/MessageKit/MessageKit/pull/1556) + +- **Breaking Change** Changed `MessagesLayoutDelegate`'s method for typing indicator size. Typing indicator's size is now correctly calculated based on delegate method `func typingIndicatorViewSize(for layout: MessagesCollectionViewFlowLayout) -> CGSize` [#1563](https://github.com/MessageKit/MessageKit/pull/1563) by [@kaspik](https://github.com/kaspik) ### Added From 8ba285aa8ad55778f767de496e383cb80de24548 Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Mon, 29 Mar 2021 21:42:12 +0200 Subject: [PATCH 21/22] Fix resources and colors --- MessageKit.podspec | 2 +- Sources/Extensions/Bundle+Extensions.swift | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/MessageKit.podspec b/MessageKit.podspec index 35fdfe81..2ab7f4b6 100644 --- a/MessageKit.podspec +++ b/MessageKit.podspec @@ -14,7 +14,7 @@ Pod::Spec.new do |s| s.swift_version = '5.3' s.ios.deployment_target = '12.0' - s.ios.resource_bundle = { 'MessageKit' => 'Sources/Assets.xcassets' } + s.ios.resources = 'Sources/Assets.xcassets' s.dependency 'InputBarAccessoryView', '~> 5.3.0' diff --git a/Sources/Extensions/Bundle+Extensions.swift b/Sources/Extensions/Bundle+Extensions.swift index 4fe47c26..f9884b50 100644 --- a/Sources/Extensions/Bundle+Extensions.swift +++ b/Sources/Extensions/Bundle+Extensions.swift @@ -29,12 +29,7 @@ internal extension Bundle { static var messageKitAssetBundle: Bundle = Bundle.module #else static var messageKitAssetBundle: Bundle { - guard let url = Bundle(for: MessagesViewController.self).url(forResource: "MessageKit", withExtension: "bundle"), - let resourcesBundle = Bundle(url: url) - else { - fatalError(MessageKitError.couldNotLoadAssetsBundle) - } - return resourcesBundle + return Bundle(for: MessagesViewController.self) } #endif } From bdb07821037d7760041c979d7986774a0edb06ef Mon Sep 17 00:00:00 2001 From: Jakub Kaspar Date: Tue, 30 Mar 2021 10:09:13 +0200 Subject: [PATCH 22/22] Prepare release --- CHANGELOG.md | 12 ++++++++++++ MessageKit.podspec | 4 ++-- Package.swift | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87442180..a95334f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Fixed +### Added + +### Changed + +### Removed + +## 3.6.0 + +### Fixed + - Fixes an issue with Scroll problem on new messages with keyboard open [#1529](https://github.com/MessageKit/MessageKit/pull/1529) by [@politan8](https://github.com/politan8) - Fixes time stamp vertical alignment so labels align with messages when showMessageTimestampOnSwipeLeft is true. @@ -17,6 +27,8 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Changed +- Changed `resource_bundle` back to `resources` in MessageKit.podspec [#1565](https://github.com/MessageKit/MessageKit/pull/1565) by [@kaspik](https://github.com/kaspik) + ### Removed ## 3.5.1 diff --git a/MessageKit.podspec b/MessageKit.podspec index 2ab7f4b6..e230705e 100644 --- a/MessageKit.podspec +++ b/MessageKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MessageKit' - s.version = '3.5.1' + s.version = '3.6.0' s.license = { :type => "MIT", :file => "LICENSE.md" } s.summary = 'An elegant messages UI library for iOS.' @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '12.0' s.ios.resources = 'Sources/Assets.xcassets' - s.dependency 'InputBarAccessoryView', '~> 5.3.0' + s.dependency 'InputBarAccessoryView', '~> 5.3.1' end diff --git a/Package.swift b/Package.swift index eaf578e2..6458bac1 100644 --- a/Package.swift +++ b/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "MessageKit", targets: ["MessageKit"]), ], dependencies: [ - .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.3.0")) + .package(url: "https://github.com/nathantannar4/InputBarAccessoryView", .upToNextMajor(from: "5.3.1")) ], targets: [ .target(