diff --git a/MessageInputBar.podspec b/MessageInputBar.podspec index 28646f6..43c5d37 100644 --- a/MessageInputBar.podspec +++ b/MessageInputBar.podspec @@ -8,10 +8,13 @@ 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", } + + s.swift_version = '4.2' + s.ios.deployment_target = '9.0' s.source = { :git => 'https://github.com/MessageKit/MessageInputBar.git', :tag => s.version } 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 diff --git a/Sources/Views/InputTextView.swift b/Sources/Views/InputTextView.swift index dc53a41..4fa62e5 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() } @@ -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 } @@ -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)