When you’re developing for iOS, there is pretty much no other game in town other than Xcode. And if you’ve needed to use it for any period of time, you know: it’s a memory hog. Not just Xcode, but the iOS simulator, Interface Builder, debugger… You can easily use several GB of memory with just the iOS development tools alone. If you have 8GB of RAM (or 4GB… 😱), it’s enough to bring Xcode to its knees, and your blood pressure to a boil. When your code completion starts lagging to the point you can’t type… 🤬
It’s 2019. Shouldn’t your machine be thinking faster than you?
But your problem may be more than just Xcode. You may want to look at what else is running on your machine to see if you need to put it on a RAM diet.