This post is targeted to anyone working on an iOS project that uses Swift and Cocoapods.
Any seasoned developer for the iOS platform using the Swift language will have by now encountered some quite bizarre errors thrown by the Swift compiler. Chances are you have already visited StackOverflow with the same exact problem and the top comment recommends to quit Xcode, wipe clean your derived data folder and restart you machine (example). To that I’d like to share a script that I use a lot on a daily basis in every single project I work on (its literally the first script I bring around with me).
The following script I call it relaunch. It kills Xcode, cleans all of the generated folders — may it be by Cocoapods or Xcode — and opens up Xcode again.
Check the gist out:
I place all of my scripts in a folder under the directory containing the Podfile.
If you find this script useful, copy-paste the script and optionally drop a like 😉. Happy coding 🙂.