Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
mobile ruleP2stack specificStack: swift
swiftdebugbuildspreview
Guard debug/preview-only code with #if DEBUG
Nice-to-have logging, preview seams and test hooks should be compiled out of release builds with #if DEBUG / #if DEV.
PR: mobile-mining-2026-06Created: Jul 5, 2026
Bad example
Old codeswift
| 1 | print("payload: \(payload)") |
Explanation (EN)
Objašnjenje (HR)
Good example
New codeswift
| 1 | #if DEBUG |
| 2 | print("payload: \(payload)") |
| 3 | #endif |
Explanation (EN)
Objašnjenje (HR)