Settings

Theme

Swifty Configuration for iOS

codingvelocity.com

15 points by codingvelocity 10 years ago · 4 comments

Reader

gilgoomesh 10 years ago

If you just want to switch between build configurations, a `#if DEBUG` compiler directive is going to be easier and more efficient.

See "Build configuration statement" on this page:

https://developer.apple.com/library/prerelease/mac/documenta...

If you want runtime configuration (change the URLs after building), it's usually a better idea to use a separate .plist file instead of the Info.plist (since Info.plist is usually reserved for data you need to communicate to the operating system). If you need compile-time generation, you can set that up as a "Build phase" in Xcode (any Build Phase script will have access to the same macros you're injecting into your .plist).

  • codingvelocityOP 10 years ago

    Thanks for the tips, I'm still ramping up on ios development and the apple eco system with a deadline I barely managed. I'll take this into consideration for the next Sprint.

wsc981 10 years ago

With this approach I thing I'd prefer to use a separate config file. Just in case Apple ever wants to add the same variable.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection