From c42363db7ebf2196a0de173c5e026cb69859782c Mon Sep 17 00:00:00 2001 From: Matt Maddux Date: Tue, 4 Feb 2020 11:04:33 -0600 Subject: [PATCH] Fix to macOS support --- Sources/FASwiftUI/FAIcon.swift | 6 +++++- Sources/FASwiftUI/FASearchHolder.swift | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/FASwiftUI/FAIcon.swift b/Sources/FASwiftUI/FAIcon.swift index 7b14ead..2c3978b 100644 --- a/Sources/FASwiftUI/FAIcon.swift +++ b/Sources/FASwiftUI/FAIcon.swift @@ -55,7 +55,11 @@ enum FACollection: String { } static func isAvailable(collection: FACollection) -> Bool { - return UIFont.familyNames.contains(collection.rawValue) + #if os(iOS) + return UIFont.familyNames.contains(collection.rawValue) + #elseif os(OSX) + return NSFontManager.shared.availableFontFamilies.contains(collection.rawValue) + #endif } } diff --git a/Sources/FASwiftUI/FASearchHolder.swift b/Sources/FASwiftUI/FASearchHolder.swift index 11a39b4..ab6ac6e 100644 --- a/Sources/FASwiftUI/FASearchHolder.swift +++ b/Sources/FASwiftUI/FASearchHolder.swift @@ -6,6 +6,8 @@ // Copyright © 2019 Matt Maddux. All rights reserved. // +#if os(iOS) + import SwiftUI class FASearchHolder: ObservableObject { @@ -62,3 +64,5 @@ class FASearchHolder: ObservableObject { } } } + +#endif