Mickael Belhassen
Mickael Belhassen

Reputation: 3342

Swift: Debug mode not working on Test flight

in my project I have code surrounded by marks of DEBUG mode #if DEBUG like this:

#if DEBUG
    let goToMainScreensGesture = UITapGestureRecognizer(target: self, action: #selector(navigateToMainStoryboard(_:)))
    goToMainScreensGesture.delegate = self
    goToMainScreensGesture.numberOfTapsRequired = 2
    logoLargeImageView.isUserInteractionEnabled = true
    logoLargeImageView.addGestureRecognizer(goToMainScreensGesture)
#endif

But that does not work, is there another alternative to add my own debug mode?

On TestFlight, Apple is automatically moving Debug mode apps to Release mode. I need to add my own global debug mode to the app for the debugging features to work.

What is the best practices on how to do this right?

Upvotes: 5

Views: 1686

Answers (1)

Vyacheslav
Vyacheslav

Reputation: 27211

Imho, most useful is to create your own custom info.plist variable and check it at runtime. If your debug mode doesn't contain secure data. Otherwise, you can use 'other linker flags' which depends on your target.

Upvotes: 1

Related Questions