Summary of solution
I suggest you to add a value in build settings. You set it to PRODUCTION
only when you build your production version.
Just use an #if
statement to check if the PRODUCTION
is set
In my app (I use Batch for push notifications)
I have 2 versions of the same app. one free with ads, one paid without ads.
I just set like this in the free version:

And like this in the paid version:

And finally I use it in code =]
// MARK: Batch.
#if FREE
#if DEBUG
print("Batch FREE - DEBUG mode")
Batch.start(withAPIKey: "-MY FREE VERSION DEBUG KEY-") // dev
#elseif RELEASE
print("Batch FREE - RELEASE mode")
Batch.start(withAPIKey: "-MY FREE VERSION RELEASE KEY-") // live
#endif
#elseif PAID
#if DEBUG
print("Batch PAID - DEBUG mode")
Batch.start(withAPIKey: "-MY PAID VERSION DEBUG KEY-") // dev
#elseif RELEASE
print("Batch PAID - RELEASE mode")
Batch.start(withAPIKey: "-MY PAID VERSION RELEASE KEY-") // live
#endif
#endif
// Register for push notifications
BatchPush.registerForRemoteNotifications()
In your case it will be manual due.
You set PRODUCTION
in Active Compilation Conditions
only when building to production.
and then add this code:
#if PRODUCTION
// Connect to production database
#else
// Connect to test database
#endif