Skip to content

Commit a1f4937

Browse files
committed
fix: Linux compatibility
1 parent fbe4609 commit a1f4937

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

Sources/CocoaAliases/CocoaAliases.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(Darwin) && canImport(ObjectiveC)
12
#if canImport(UIKit)
23
import UIKit
34
import CocoaMarkerProtocols
@@ -191,3 +192,4 @@ public typealias CocoaViewController = NSViewCo
191192
public typealias CocoaVisualEffectView = NSVisualEffectView
192193
public typealias CocoaWindow = NSWindow
193194
#endif
195+
#endif

Sources/CocoaAliases/CollectionView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(Darwin) && canImport(ObjectiveC)
12
#if canImport(UIKit)
23
import UIKit
34

@@ -201,3 +202,4 @@ extension NSDirectionalEdgeInsets {
201202
return NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)
202203
}
203204
}
205+
#endif

Sources/CocoaAliases/SwiftUI.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(Darwin) && canImport(ObjectiveC)
12
#if canImport(UIKit) && canImport(SwiftUI)
23
import SwiftUI
34

@@ -124,3 +125,4 @@ extension CocoaViewControllerRepresentable {
124125
}
125126
}
126127
#endif
128+
#endif

Sources/CocoaAliases/TableView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if canImport(Darwin) && canImport(ObjectiveC)
12
#if canImport(UIKit)
23
import UIKit
34

@@ -49,3 +50,4 @@ public typealias CocoaDiffableDataSourceSnapshot = NSDiffableDataSourceSnapshot
4950
@available(macOS 10.15.1, iOS 13, *)
5051
@available(watchOS, unavailable)
5152
public typealias CocoaDiffableDataSourceSnapshotReference = NSDiffableDataSourceSnapshotReference
53+
#endif

0 commit comments

Comments
 (0)