TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Swifty Configuration for iOS

15 pointsby codingvelocityover 9 years ago

2 comments

gilgoomeshover 9 years ago
If you just want to switch between build configurations, a `#if DEBUG` compiler directive is going to be easier and more efficient.<p>See &quot;Build configuration statement&quot; on this page:<p><a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;prerelease&#x2F;mac&#x2F;documentation&#x2F;Swift&#x2F;Conceptual&#x2F;Swift_Programming_Language&#x2F;Statements.html" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;library&#x2F;prerelease&#x2F;mac&#x2F;documenta...</a><p>If you want runtime configuration (change the URLs after building), it&#x27;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 &quot;Build phase&quot; in Xcode (any Build Phase script will have access to the same macros you&#x27;re injecting into your .plist).
评论 #11011719 未加载
wsc981over 9 years ago
With this approach I thing I&#x27;d prefer to use a separate config file. Just in case Apple ever wants to add the same variable.
评论 #11012095 未加载