Skip to content

Commit 4cc2dff

Browse files
authored
Fix compilation issues when building SwiftUI Previews for macOS. (#376)
1 parent cbcb39b commit 4cc2dff

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Source/Device.generated.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
#if os(watchOS)
1313
import WatchKit
14-
#else
14+
#elseif canImport(UIKit)
1515
import UIKit
16+
#else
17+
import Foundation
1618
#endif
1719

1820
// MARK: Device

Source/Device.swift.gyb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ watchOSDevices = watches
299299
}%
300300
#if os(watchOS)
301301
import WatchKit
302-
#else
302+
#elseif canImport(UIKit)
303303
import UIKit
304+
#else
305+
import Foundation
304306
#endif
305307

306308
// MARK: Device

0 commit comments

Comments
 (0)