I would prefer to use the same build configuration for TestFlight vs. App Store. Is there a way to detect at runtime whether the app has been installed via TestFlight or the
To determine Debug, TestFlight or AppStore deployment in Swift:
private static let isTestFlight = NSBundle.mainBundle().appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
// This can be used to add debug statements.
static var isDebug: Bool {
#if DEBUG
return true
#else
return false
#endif
}
Complete source and sample: https://stackoverflow.com/a/33830605/639227