Import library only with supported iOS version

Viewed 59

I have iOS app and project which supports old iOS versions and I don't want to cut these versions yet because I still have users that have them. I want to use Customer.io library but it supports iOS 13 and higher. When I try to import that library I get:

Compiling for iOS 10.3, but module 'CioTracking' has a minimum deployment target of iOS 13.0

How can I set to import library only on iOS 13 and higher? I know that I can mark entire class with @available(iOS 13.0) but it doesn't fix my problem. Is there any compile check condition that can I use? I tried:

#if canImport(CioTracking)
    import CioTracking
#endif

I added library via SPM but I can use Cocoapods too.

Any idea how to added it? Thanks for any help

0 Answers
Related