How many times do we submit a build to production and forgot to change something?? For me is more than I want 🤯
For this reason, I had to find a way to prevent this, and this is my solution, I’m sure there are lots of people like me (hope so 😊)
Let’s say that we have this swift file with some configurations for API calls.
What I need is this simple thing, every time I build the app Xcode should give me a warning if I’m not using the production environment, and when releasing for production should give me an error, that’s it 💪
The way I achieved this was by creating a New Run Script Phase in Build Phases with some shell script.
That’s all we need 💥💥💥
So now every time you build your project you will see a warning if production it’s not used.
And when you archive you will see this 😇