Hi,
I was wondering if there is a simplified way of checking if my code was being built on an Apple OS (macOS, iOS, tvOS, watchOS) or not.
The reason for this is because sadly there are still some differences between the Apple Swift and the Open Swift. A good recent example of this, in Swift 5.1, is that Process.currentDirectoryURL has a slightly different value type. In Apple Swift its Process.currentDirectoryURL: URL? where as in Open Swift it's Process.currentDirectoryURL: URL
Currently to combat this I use the #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS). OR more recently I've been switching to #if _runtime(_ObjC). However I believe this to be unsafe because I'm sure its not a public function and could be removed at any moment.
I was hoping there was a simplified #if os(appleOS) or #if runtime(apple) or something like that which would be an indication that the code was being built within Apple Swift SDK
Any help/suggestions would be greatly appreciated.