TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Swifty Configuration for iOS

15 点作者 codingvelocity超过 9 年前

2 条评论

gilgoomesh超过 9 年前
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 未加载
wsc981超过 9 年前
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 未加载