From 4158a60b4c88e544eee53e7bb043dfb74bc19543 Mon Sep 17 00:00:00 2001 From: zhgchgli Date: Thu, 9 Mar 2023 22:58:26 +0800 Subject: [PATCH] [Fix] nstextview image --- Sources/ZNSTextAttachment/ZResizableNSTextAttachment.swift | 4 +++- scripts/ZNSTextAttachment.podspec | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/ZNSTextAttachment/ZResizableNSTextAttachment.swift b/Sources/ZNSTextAttachment/ZResizableNSTextAttachment.swift index 5debdd7..9bdacc4 100644 --- a/Sources/ZNSTextAttachment/ZResizableNSTextAttachment.swift +++ b/Sources/ZNSTextAttachment/ZResizableNSTextAttachment.swift @@ -26,7 +26,9 @@ public class ZResizableNSTextAttachment: NSTextAttachment { super.init(data: data, ofType: type) - self.attachmentCell = NSTextAttachmentCell.init(imageCell: NSImage(data: data)) + #if canImport(AppKit) + self.attachmentCell = NSTextAttachmentCell.init(imageCell: NSImage(data: data)) + #endif } required init?(coder: NSCoder) { diff --git a/scripts/ZNSTextAttachment.podspec b/scripts/ZNSTextAttachment.podspec index 964fa78..24cae30 100644 --- a/scripts/ZNSTextAttachment.podspec +++ b/scripts/ZNSTextAttachment.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "ZNSTextAttachment" - s.version = "1.1.5" + s.version = "1.1.6" s.summary = "ZNSTextAttachment enables NSTextAttachment to download images from remote URLs." s.homepage = "https://github.com/ZhgChgLi/ZNSTextAttachment" s.license = { :type => "MIT", :file => "LICENSE" }