Reputation: 55634
Is there a Swift compiler directive for #if not
?
I know this could work
#if myFlag
// ignore
#else
bar()
#endif
But it is not pretty if there is nothing between if
and else
.
Upvotes: 44
Views: 12648
Reputation: 55634
I wasn't trying enough, I found out
#if !myFlag
#endif
works well !
Upvotes: 120