From 38a4b3cb03ad2ca1919a6e880432355741791ef2 Mon Sep 17 00:00:00 2001 From: Daniele Margutti Date: Tue, 7 Jul 2020 16:17:32 +0200 Subject: [PATCH 1/2] fix #118: Fix for NSTextAttachment --- .../Extensions/AttributedString+Attachments.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftRichString/Extensions/AttributedString+Attachments.swift b/Sources/SwiftRichString/Extensions/AttributedString+Attachments.swift index 86dd740..fb971c7 100644 --- a/Sources/SwiftRichString/Extensions/AttributedString+Attachments.swift +++ b/Sources/SwiftRichString/Extensions/AttributedString+Attachments.swift @@ -105,7 +105,10 @@ public extension AttributedString { attachment.image = image.withRenderingMode(.alwaysOriginal) } } else { - attachment = NSTextAttachment(data: image.pngData()!, ofType: "png") + // It does not work on iOS12, return empty set.s + // attachment = NSTextAttachment(data: image.pngData()!, ofType: "png") + attachment = NSTextAttachment() + attachment.image = image.withRenderingMode(.alwaysOriginal) } #endif From d031892b3f41d762c67973e526e604f82a5e7a8b Mon Sep 17 00:00:00 2001 From: Daniele Margutti Date: Tue, 7 Jul 2020 16:18:25 +0200 Subject: [PATCH 2/2] Bump to 3.7.2 --- SwiftRichString.podspec | 2 +- SwiftRichString.xcodeproj/project.pbxproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SwiftRichString.podspec b/SwiftRichString.podspec index d070435..59cc4c1 100644 --- a/SwiftRichString.podspec +++ b/SwiftRichString.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SwiftRichString" - s.version = "3.7.1" + s.version = "3.7.2" s.summary = "Elegant Strings & Attributed Strings Toolkit for Swift" s.description = <<-DESC SwiftRichString is the best toolkit to work easily with Strings and Attributed Strings. diff --git a/SwiftRichString.xcodeproj/project.pbxproj b/SwiftRichString.xcodeproj/project.pbxproj index 74feadf..33ad8b7 100644 --- a/SwiftRichString.xcodeproj/project.pbxproj +++ b/SwiftRichString.xcodeproj/project.pbxproj @@ -1640,7 +1640,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 3.7.1; + MARKETING_VERSION = 3.7.2; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-iOS"; PRODUCT_NAME = SwiftRichString; @@ -1666,7 +1666,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.11; - MARKETING_VERSION = 3.7.1; + MARKETING_VERSION = 3.7.2; PRODUCT_BUNDLE_IDENTIFIER = "com.SwiftRichString.SwiftRichString-iOS"; PRODUCT_NAME = SwiftRichString; SKIP_INSTALL = YES;