---
title: "Discussion on \"SDK conditional code with canImport(module, _version: \"1.2.3.4\")\" | Hashnode"
description: "Discussion on \"SDK conditional code with canImport(module, _version: \"1.2.3.4\")\". Pass version of a module to #if canImport(module, _version: \"1.2.3.4\") to introduce SDK conditional code as alternative to #if swift or #if compiler"
url: "https://hashnode.com/posts/sdk-conditional-code-with-canimportmodule-version-1234/64226dd6f4c855772ba6fd78"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [SDK conditional code with canImport(module, \_version: "1.2.3.4")](https://blog.eidinger.info/sdk-conditional-code-with-canimportmodule-version-1234?utm_source=hashnode&utm_medium=feed)

Pass version of a module to #if canImport(module, \_version: "1.2.3.4") to introduce SDK conditional code as alternative to #if swift or #if compiler

Mar 28, 2023 · 3 min read · blog.eidinger.info  
Read the article

-   [#swift](https://hashnode.com/tag/swift)
-   [#ios](https://hashnode.com/tag/ios)
-   [#xcode](https://hashnode.com/tag/xcode)

## Written by

[Marco Eidinger](https://hashnode.com/@MarcoEidinger)

@MarcoEidinger

  
[View profile](https://hashnode.com/@MarcoEidinger)

#Swift #iOS SDK architect 🇺🇸 🇩🇪

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
