19 November 2021
If you are working on a multiplatform SwiftUI project, you will start accumulating
#if os() checks and
#if canImport() checks. Overtime, these start to accumulate and — in addition to being unsightly — they make your code much more difficult to read. When possible, I have started to encapsulate these preprocessor directives to improve code organization and readability.