> #if canImport(UIKit)
>    // UIKit-based code
>    #elseif canImport(Cocoa)
>    // OSX code
>    #elseif
>    // Workaround/text, whatever
> #endif

My question is simple: Are there cases where you want to test if you can import 
something, but you don't want to *actually* import it? If not, should we 
perhaps just do this?

        #if import UIKit
                // UIKit-based code, has UIKit available
        #elseif import Cocoa
                // OS X code, has Cocoa available
        #else
                // Fallback
        #endif

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to