In Swift 2, how can I use the #available
condition to prevent a block of code from executing on a certain platform? The *
seems to allow the version you specify in your deployment target. And specifying iOS Int.max
doesn't work.
Making code not runnable on other platforms
60 views Asked by vrwim At
2
#available
is used for specifying certain versions on certain platforms. If you only want to limit your code to a certain platform, you can use compiler directives.But I believe the reason what you were trying to do with
Int.max
wasn't working because it requires anUInt32
literal (i.e. up to 4294967295 which is (2^32) - 1 or UInt32.max -1):