Skip to content

Commit 7e1dd8a

Browse files
authored
fix: Guard AppKit against macOS (#15)
1 parent e6cece0 commit 7e1dd8a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Sources/SelectableCollectionView/Utilities/NavigationDirection.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
// SOFTWARE.
2020

21-
#if os(macOS)
2221

22+
import Foundation
23+
24+
#if os(macOS)
2325
import AppKit
2426
import Carbon
27+
#endif
2528

2629
enum NavigationDirection {
2730
case up
2831
case down
2932
case left
3033
case right
3134

35+
#if os(macOS)
3236
init?(_ keyCode: UInt16) {
3337
switch Int(keyCode) {
3438
case kVK_LeftArrow:
@@ -43,7 +47,6 @@ enum NavigationDirection {
4347
return nil
4448
}
4549
}
50+
#endif
4651

4752
}
48-
49-
#endif

0 commit comments

Comments
 (0)