On Mar 28, 2016, at 10:37 PM, Jeff Kelley via swift-evolution <[email protected]> wrote: > > This might be crazy, but we could also reuse try here: > > import Foundation > try import UIKit { > // UIKit Code > } > else try import Cocoa > // Cocoa Code > } > > This would attempt to import UIKit and if it succeeded, run the code in the > closure. >
The problem with your approach is that the Cocoa code would have to compile under iOS and I'm afraid that's a no-go. Build-configuration tests enable entire blocks of code to be removed from compilation. -- E _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
