Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have different api urls for staging and production in Swift and Xcode 6

Tags:

xcode

ios

swift

So I'm building an app that accesses an API that lives on our servers. So obviously there will be a different url for the staging server, vs the live app (that lives int the app store) which will point to the production server api url. What's the best/easiest way to accomplish that in Swift using Xcode 6? And then how do you go about accessing those urls in your controllers/app?

like image 687
kevindeleon Avatar asked Dec 11 '25 10:12

kevindeleon


1 Answers

The answer I was looking for was Swift specific...I found it at the following link. It can be accomplished using Swift custom compiler flags and Schemes.

http://dev.iachieved.it/iachievedit/build-configuration-management-with-swift/

like image 76
kevindeleon Avatar answered Dec 13 '25 04:12

kevindeleon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!