From 9f97745b9b89f880dd89e96510cc8b5a072f3d3b Mon Sep 17 00:00:00 2001 From: Akring Date: Fri, 29 Mar 2024 21:18:19 +0800 Subject: [PATCH] fix: Add #if os(macOS) macro --- Lib/KeyHolder/ClearButton.swift | 3 ++- Lib/KeyHolder/Extensions/NSColorExtension.swift | 3 ++- Lib/KeyHolder/RecordView.swift | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Lib/KeyHolder/ClearButton.swift b/Lib/KeyHolder/ClearButton.swift index c04a7f6..fe2e9e2 100644 --- a/Lib/KeyHolder/ClearButton.swift +++ b/Lib/KeyHolder/ClearButton.swift @@ -7,7 +7,7 @@ // // Copyright © 2015-2020 Clipy Project. // - +#if os(macOS) import Cocoa final class ClearButton: NSButton { @@ -85,3 +85,4 @@ final class ClearButton: NSButton { // swiftlint:enable function_body_length } +#endif diff --git a/Lib/KeyHolder/Extensions/NSColorExtension.swift b/Lib/KeyHolder/Extensions/NSColorExtension.swift index 5be65ca..86a399c 100644 --- a/Lib/KeyHolder/Extensions/NSColorExtension.swift +++ b/Lib/KeyHolder/Extensions/NSColorExtension.swift @@ -7,7 +7,7 @@ // // Copyright © 2015-2020 Clipy Project. // - +#if os(macOS) import AppKit extension NSColor { @@ -18,3 +18,4 @@ extension NSColor { return NSColor(red: 0.525490196, green: 0.525490196, blue: 0.525490196, alpha: 1) }() } +#endif diff --git a/Lib/KeyHolder/RecordView.swift b/Lib/KeyHolder/RecordView.swift index 86cee04..4047191 100644 --- a/Lib/KeyHolder/RecordView.swift +++ b/Lib/KeyHolder/RecordView.swift @@ -7,7 +7,7 @@ // // Copyright © 2015-2020 Clipy Project. // - +#if os(macOS) import Cocoa import Carbon import Magnet @@ -344,3 +344,4 @@ public extension RecordView { case whenRecorded } } +#endif