textmate / swift.tmbundle

TextMate support for Swift
72 stars 30 forks source link

Add availability check support for UIKitForMac #37

Closed a2 closed 5 years ago

a2 commented 5 years ago

This fixes issues with UIKitForMac and UIKitForMacApplicationExtension.

jtbandes commented 5 years ago

What do you think of this instead? https://github.com/textmate/swift.tmbundle/pull/38 (I also added canImport and targetEnvironment.)

Your PR supports if #available(UIKitForMac 1), but I don't see any evidence that's actually supported — in a GitHub search, it looks like it can only be used as @available(UIKitForMac, *) and #if targetEnvironment(UIKitForMac). Can you link to example code or documentation that uses UIKitForMac inside #available?

a2 commented 5 years ago

Maybe I’m doing it wrong but in my personal projects I’m doing this:

if #available(iOS 13.0, UIKitForMac 13.0, *) {
    ...
}
jtbandes commented 5 years ago

Alright, I can include that too then.