Skip to content

Commit 1bd5a7b

Browse files
committed
Add canImport check for UIKit
1 parent afea94a commit 1bd5a7b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

FeatureFlags/Classes/UI/Feature Flags/Shared/UIControl.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
import Foundation
99
import ObjectiveC
10+
#if canImport(UIKit)
11+
import UIKit
1012

1113
public extension NSObject {
1214
func associatedObject<T>(key: UnsafeRawPointer, makeDefault: () -> T) -> T {
@@ -43,3 +45,4 @@ public extension UIControl {
4345
}
4446
}
4547
}
48+
#endif

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ let package = Package(
1010
products: [
1111
.library(
1212
name: "FeatureFlags",
13-
targets: ["FeatureFlags"])
13+
targets: ["FeatureFlags"]
14+
)
1415
],
1516
targets: [
1617
.target(

0 commit comments

Comments
 (0)