From 5ac3c2170dd1b5137115c3f2dac7ab9c00a0e9ff Mon Sep 17 00:00:00 2001 From: Anton Nazarov Date: Wed, 11 Sep 2019 14:22:39 -0700 Subject: [PATCH] Fix SPM support --- Package.swift | 2 +- Sources/Storyboard/StoryboardBased.swift | 2 ++ Sources/Storyboard/StoryboardSceneBased.swift | 2 ++ Sources/View/NibLoadable.swift | 2 ++ Sources/View/NibOwnerLoadable.swift | 2 ++ Sources/View/Reusable.swift | 2 ++ Sources/View/UICollectionView+Reusable.swift | 2 ++ Sources/View/UITableView+Reusable.swift | 2 ++ 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 51efd73..672cb7f 100644 --- a/Package.swift +++ b/Package.swift @@ -15,5 +15,5 @@ let package = Package( sources: ["Sources"] ) ], - swiftLanguageVersions: [3, 4, 5] + swiftLanguageVersions: [.v4, .v5] ) diff --git a/Sources/Storyboard/StoryboardBased.swift b/Sources/Storyboard/StoryboardBased.swift index 9bcc7ff..7e26f9a 100644 --- a/Sources/Storyboard/StoryboardBased.swift +++ b/Sources/Storyboard/StoryboardBased.swift @@ -6,6 +6,7 @@ * *********************************************/ +#if canImport(UIKit) import UIKit // MARK: Protocol Definition @@ -45,3 +46,4 @@ public extension StoryboardBased where Self: UIViewController { return typedViewController } } +#endif diff --git a/Sources/Storyboard/StoryboardSceneBased.swift b/Sources/Storyboard/StoryboardSceneBased.swift index 3fd720f..8f96e32 100644 --- a/Sources/Storyboard/StoryboardSceneBased.swift +++ b/Sources/Storyboard/StoryboardSceneBased.swift @@ -6,6 +6,7 @@ * *********************************************/ +#if canImport(UIKit) import UIKit // MARK: Protocol Definition @@ -51,3 +52,4 @@ public extension StoryboardSceneBased where Self: UIViewController { return typedViewController } } +#endif diff --git a/Sources/View/NibLoadable.swift b/Sources/View/NibLoadable.swift index 773e7ab..b43c6c9 100755 --- a/Sources/View/NibLoadable.swift +++ b/Sources/View/NibLoadable.swift @@ -6,6 +6,7 @@ * *********************************************/ +#if canImport(UIKit) import UIKit // MARK: Protocol Definition @@ -45,3 +46,4 @@ public extension NibLoadable where Self: UIView { return view } } +#endif diff --git a/Sources/View/NibOwnerLoadable.swift b/Sources/View/NibOwnerLoadable.swift index 3cd1711..cd94b41 100644 --- a/Sources/View/NibOwnerLoadable.swift +++ b/Sources/View/NibOwnerLoadable.swift @@ -6,6 +6,7 @@ * *********************************************/ +#if canImport(UIKit) import UIKit // MARK: Protocol Definition @@ -52,6 +53,7 @@ public extension NibOwnerLoadable where Self: UIView { } } } +#endif /// Swift < 4.2 support #if !(swift(>=4.2)) diff --git a/Sources/View/Reusable.swift b/Sources/View/Reusable.swift index 28f8e01..2267ad4 100644 --- a/Sources/View/Reusable.swift +++ b/Sources/View/Reusable.swift @@ -6,6 +6,7 @@ * *********************************************/ +#if canImport(UIKit) import UIKit // MARK: Protocol definition @@ -31,3 +32,4 @@ public extension Reusable { return String(describing: self) } } +#endif diff --git a/Sources/View/UICollectionView+Reusable.swift b/Sources/View/UICollectionView+Reusable.swift index 318ce38..a6f9f2b 100644 --- a/Sources/View/UICollectionView+Reusable.swift +++ b/Sources/View/UICollectionView+Reusable.swift @@ -6,6 +6,7 @@ * *********************************************/ +#if canImport(UIKit) import UIKit // MARK: Reusable support for UICollectionView @@ -128,3 +129,4 @@ public extension UICollectionView { return typedView } } +#endif diff --git a/Sources/View/UITableView+Reusable.swift b/Sources/View/UITableView+Reusable.swift index fc36044..c5ca194 100644 --- a/Sources/View/UITableView+Reusable.swift +++ b/Sources/View/UITableView+Reusable.swift @@ -6,6 +6,7 @@ * *********************************************/ +#if canImport(UIKit) import UIKit // MARK: Reusable support for UITableView @@ -108,3 +109,4 @@ public extension UITableView { return view } } +#endif