No idea about the Objective-C part, but for checking swift versions you can have this kind of conditional code:
This is for the swift compiler version used (better for detecting the Xcode version used to compile):
#if compiler(>=5.1)
// do something
#endif
This is for the actual swift language version used:
#if swift(>=5.1)
// do something
#endif
Topic:
Programming Languages
SubTopic:
Swift
Tags: