diff --git a/Lib/Magnet/Extensions/CollectionExtension.swift b/Lib/Magnet/Extensions/CollectionExtension.swift index 71b2c6d..7d2dffd 100644 --- a/Lib/Magnet/Extensions/CollectionExtension.swift +++ b/Lib/Magnet/Extensions/CollectionExtension.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Foundation public extension Collection where Element == Bool { @@ -15,3 +16,4 @@ public extension Collection where Element == Bool { return filter { $0 }.count } } +#endif diff --git a/Lib/Magnet/Extensions/IntExtension.swift b/Lib/Magnet/Extensions/IntExtension.swift index 5eff77c..379f6b9 100644 --- a/Lib/Magnet/Extensions/IntExtension.swift +++ b/Lib/Magnet/Extensions/IntExtension.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Cocoa import Carbon @@ -22,3 +23,4 @@ public extension Int { return NSEvent.ModifierFlags(carbonModifiers: self) } } +#endif diff --git a/Lib/Magnet/Extensions/KeyExtension.swift b/Lib/Magnet/Extensions/KeyExtension.swift index e0aa9ba..1f166fe 100644 --- a/Lib/Magnet/Extensions/KeyExtension.swift +++ b/Lib/Magnet/Extensions/KeyExtension.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Foundation import Sauce @@ -73,3 +74,4 @@ public extension Key { } } } +#endif diff --git a/Lib/Magnet/Extensions/NSEventExtension.swift b/Lib/Magnet/Extensions/NSEventExtension.swift index 76da882..8619182 100644 --- a/Lib/Magnet/Extensions/NSEventExtension.swift +++ b/Lib/Magnet/Extensions/NSEventExtension.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Cocoa import Carbon import Sauce @@ -118,3 +119,4 @@ extension NSEvent { return KeyCombo(key: key, cocoaModifiers: self.modifierFlags) } } +#endif diff --git a/Lib/Magnet/HotKey.swift b/Lib/Magnet/HotKey.swift index 37d15fc..62a1c7c 100644 --- a/Lib/Magnet/HotKey.swift +++ b/Lib/Magnet/HotKey.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Cocoa import Carbon @@ -106,3 +107,4 @@ extension HotKey { self.hotKeyRef == hotKey.hotKeyRef } } +#endif diff --git a/Lib/Magnet/HotKeyCenter.swift b/Lib/Magnet/HotKeyCenter.swift index 1b7dc8d..c058c94 100644 --- a/Lib/Magnet/HotKeyCenter.swift +++ b/Lib/Magnet/HotKeyCenter.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Cocoa import Carbon @@ -168,3 +169,4 @@ extension HotKeyCenter { } } } +#endif diff --git a/Lib/Magnet/KeyCombo.swift b/Lib/Magnet/KeyCombo.swift index 6dd3152..e8a3885 100644 --- a/Lib/Magnet/KeyCombo.swift +++ b/Lib/Magnet/KeyCombo.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Cocoa import Carbon import Sauce @@ -178,3 +179,4 @@ open class KeyCombo: NSObject, NSCopying, NSCoding, Codable { extension KeyCombo { public struct InitializeError: Error {} } +#endif diff --git a/Lib/Magnet/ModifierEventHandler.swift b/Lib/Magnet/ModifierEventHandler.swift index a1ed1b0..19c5852 100644 --- a/Lib/Magnet/ModifierEventHandler.swift +++ b/Lib/Magnet/ModifierEventHandler.swift @@ -8,6 +8,7 @@ // Copyright © 2015-2020 Clipy Project. // +#if os(macOS) import Cocoa open class ModifierEventHandler { @@ -70,3 +71,4 @@ extension ModifierEventHandler { } } } +#endif