Skip to content

My First App

ZefengYu edited this page Jan 5, 2017 · 7 revisions

1. 区分Debug 和 Release模式

XCode8之前

swift也支持类似C语言一样的Macro 操作步骤:

  1. Target
  2. Build setting
  3. Swift Compiler - Custom Flags
  4. Debug,添加-D DEBUG

XCode8之后

Active Compilation Conditions Debug,添加DEBUG,不加-D

#if DEBUG #else #endif

2. ATS配置

load an except HTTP URL with App Transport Security enabled in iOS 9

<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <false/> <key>NSExceptionDomains</key> <dict> <key><!-your domain-!></key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSExceptionRequiresForwardSecrecy</key> <true/> </dict> </dict> </dict>

Clone this wiki locally