Conditionally import a framework (such as Speech) based on iOS Version in Swift?

You can make the Framework optional (details and image from Ray Wenderlicht):

Making a framework optional

This, combined with your use of @available, should prevent the system from trying to load it on the devices where it is not available.

Leave a Comment