I'm preparing a separate platform proposal. I want to make clear that the 
intent is to use the 
framework being tested. However, the test that does the import may be separated 
from the code
that uses the framework, which is why the call does not import.

-- E


> On Mar 22, 2016, at 10:24 PM, Brent Royal-Gordon <[email protected]> 
> wrote:
> 
>> #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