You can use the following code snippets to determine whether your app is running in debug mode or if it is a TestFlight version. This can be quite useful if you want to add a debug menu or something like this internally.
// Will be true when the build is in TestFlight (running an app download from TestFlight)
let isTestFlight = NSBundle.mainBundle().appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
// Will be true when the build is a debug build (usually when running from Xcode directly)
static var isDebug: Bool {
#if DEBUG
return true
#else
return false
#endif
}