-
Notifications
You must be signed in to change notification settings - Fork 0
#error
Ken Harris edited this page Dec 20, 2017
·
5 revisions
Swift has an #if
system for conditional compilation, but there's no #error
, so there's no obvious way to halt compilation. Easy workaround: import a library that doesn't exist.
#if os(macOS)
import AppKit
#elseif os(iOS)
import UIKit
#else
import CompileTimeErrorPlease
#endif