5

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?

Mickael Belhassen
  • 2,970
  • 1
  • 25
  • 46

1 Answers1

1

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.

Vyacheslav
  • 26,359
  • 19
  • 112
  • 194