From 0d2ea1b85a708f37d6b720a3b316e63a39ace4b8 Mon Sep 17 00:00:00 2001 From: Nathan Tannar Date: Sat, 29 Sep 2018 12:04:02 -0700 Subject: [PATCH 1/5] Add note to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f84e89a..74f056a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ github "MessageKit/MessageInputBar" - **iOS 9** or later - **Swift 4** or later +> Version 0.4.0 onwards is only Swift 4.2 compatible + ## Contributing From faebe27f2dd8f39ea145e75b7296ef48133c099a Mon Sep 17 00:00:00 2001 From: Nathan Tannar Date: Thu, 4 Oct 2018 10:37:28 -0700 Subject: [PATCH 2/5] Fix Default Placeholder Padding --- MessageInputBar.podspec | 2 +- Sources/Views/InputTextView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MessageInputBar.podspec b/MessageInputBar.podspec index 28646f6..e5cc4c5 100644 --- a/MessageInputBar.podspec +++ b/MessageInputBar.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.requires_arc = true # 2 - Version - s.version = '0.4.0' + s.version = '0.4.1' s.pod_target_xcconfig = { "SWIFT_VERSION" => "4.2", } diff --git a/Sources/Views/InputTextView.swift b/Sources/Views/InputTextView.swift index dc53a41..294f387 100644 --- a/Sources/Views/InputTextView.swift +++ b/Sources/Views/InputTextView.swift @@ -86,7 +86,7 @@ open class InputTextView: UITextView { } /// The `UIEdgeInsets` the placeholderLabel has within the `InputTextView` - open var placeholderLabelInsets: UIEdgeInsets = UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 4) { + open var placeholderLabelInsets: UIEdgeInsets = UIEdgeInsets(top: 8, left: 4, bottom: 8, right: 4) { didSet { updateConstraintsForPlaceholderLabel() } From b2fdc8398ffb52726faa05828105f8459cca8e4b Mon Sep 17 00:00:00 2001 From: Keith Black Date: Mon, 7 Jan 2019 21:41:34 -0600 Subject: [PATCH 3/5] Fixed crash when inserting text and multiple images. --- Sources/Views/InputTextView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Views/InputTextView.swift b/Sources/Views/InputTextView.swift index 294f387..1a0dddf 100644 --- a/Sources/Views/InputTextView.swift +++ b/Sources/Views/InputTextView.swift @@ -347,7 +347,7 @@ open class InputTextView: UITextView { attachments.forEach { (attachment) in let (range, image) = attachment if curLocation < range.location { - let textRange = NSMakeRange(curLocation, range.location) + let textRange = NSMakeRange(curLocation, range.location-curLocation) let text = attributedText.attributedSubstring(from: textRange).string.trimmingCharacters(in: .whitespacesAndNewlines) if !text.isEmpty { components.append(text) From 20d2bdaab469877a2a40df2657507ec15d917520 Mon Sep 17 00:00:00 2001 From: briantom Date: Tue, 12 Feb 2019 21:50:58 -0800 Subject: [PATCH 4/5] updated podspecs swift language version to 4.2 --- MessageInputBar.podspec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MessageInputBar.podspec b/MessageInputBar.podspec index e5cc4c5..43c5d37 100644 --- a/MessageInputBar.podspec +++ b/MessageInputBar.podspec @@ -12,6 +12,9 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { "SWIFT_VERSION" => "4.2", } + + s.swift_version = '4.2' + s.ios.deployment_target = '9.0' s.source = { :git => 'https://github.com/MessageKit/MessageInputBar.git', :tag => s.version } From 13a508b093b5bff5c94517d60fb7ec2bb53a18eb Mon Sep 17 00:00:00 2001 From: Nicolas Fogg Date: Tue, 26 Mar 2019 13:03:59 +1100 Subject: [PATCH 5/5] Use the source image orientation when creating an image text attachment --- Sources/Views/InputTextView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Views/InputTextView.swift b/Sources/Views/InputTextView.swift index 1a0dddf..4fa62e5 100644 --- a/Sources/Views/InputTextView.swift +++ b/Sources/Views/InputTextView.swift @@ -288,7 +288,7 @@ open class InputTextView: UITextView { guard let cgImage = image.cgImage else { return NSTextAttachment() } let scale = image.size.width / (frame.width - 2 * (textContainerInset.left + textContainerInset.right)) let textAttachment = NSTextAttachment() - textAttachment.image = UIImage(cgImage: cgImage, scale: scale, orientation: .up) + textAttachment.image = UIImage(cgImage: cgImage, scale: scale, orientation: image.imageOrientation) return textAttachment }