Conditional compilation is generally recognized as a bad practice that is occasionally necessary when dealing with platform-specific code. As much as possible, code should be refactored to minimize or eliminate conditionally-compiled, platform-specific code because even when necessary and well-intentioned, such code segments can leave your codebase in a hopeless tangle.
WDYT May be it's worth mentioning in this rule? (smth like "But to able to run some pieces of code only on specific OS releases you can use availability checking (since Swift 2.0)")
UPDATE I've attached screenshot from documentation (it's from book and it doesn't allow me copy content)
=== on 23 Jun 2015, 14:22:21 Ann Campbell wrote:
I like it [~elena.vilchik] but I'm wondering about timing. Are you not likely to implement this rule until after Swift 2.0 is released?
=== on 24 Jun 2015, 08:04:59 Elena Vilchik wrote:
\[~ann.campbell.2] ok, let's keep it for Swift 2.0 release (ticket created SWIFT-162)
=== on 10 Dec 2015, 15:02:00 Ann Campbell wrote:
expanded per your request [~elena.vilchik]
=== on 10 Dec 2015, 15:15:10 Elena Vilchik wrote:
\[~ann.campbell.2] Actually availability-checking should be compliant :) This piece should help people facing this rule to fix the issue by replacing preprocessor directives by ``++if #available ...++``.