swift-bson, a dependency of mongo-swift-driver, has a minimum supported version of iOS 13
mongo-swift-driver does not specify a minimum supported iOS version, because it is not intended to be used directly in iOS applications, so Xcode assumes the minimum version to be iOS 9
Sorry that the error here isn’t very clear; I’m currently investigating to see if there’s some way we can specify a custom error message to emit in this case.
If you’d like to use the Swift driver for building an iOS app, the architecture I would recommend is to build a backend server using a web framework like Vapor which handles interactions with the database, and having your iOS app communicate with that backend via HTTP. We have an example app doing exactly that available here.
To name a few reasons why it is not recommended to use a database driver directly from an iOS app:
This would require shipping database access credentials with your app source code, which is both insecure and also makes it difficult to rotate them without forcing users to upgrade to a newer version of your app. If you handle this in a backend, you do not need to distribute the credentials, and you can easily change them without your users needing to update their app.
This would require allowing arbitrary IP addresses to connect to your database (since users could be using your app from any IP), which makes your database more vulnerable to attackers. If you use a backend, you only need to allow the IP address where the backend is running to connect to your database.
If any instance of an iOS app is allowed to connect directly to your database you have no way of throttling the number of connections made to your database, which can overwhelm it. However, if all database interaction is handled via a unified backend with a single MongoClient, you can limit the number of concurrent database connections via options such as maxPoolSize. Also, a backend allows you to more efficiently reuse database connections since they can be re-used for requests from any user, not just the user on a particular iOS device.
Another alternative to consider if you don’t want to write a backend would be using Realm, which allows you to both store data on-device and also sync it to a MongoDB cluster running on MongoDB Atlas via Realm Sync.