You pretty much have to use Xcode or Apple provided toolchain for building iOS apps.
You do not have to use Apple toolchain for building macOS apps, if you are content with the fact, that your binaries might be broken in future macOS releases. With point releases, even. For a case study, see golang.
Work gave me my first smart phone, an iPhone. I thought it was great at first. Then I started to use it, transfer photos, etc. Then I saw the number of hoops you had to jump through to make an app and get it on your phone. That was enough for me. It was a while ago, but I have my doubts that it was much easier. I try to steer people away from an iPhone if they don't have a mac. They just don't play nice with others. Development is the same. I never did make an iPhone app because I didn't have a mac.
My next phone was one I bought, a Nexus device from google. Want to get an app on it? Download the SDK and tools, fire up hello world, throw it on your phone and it works.
> Download the SDK and tools, fire up hello world, throw it on your phone and it works.
This is exactly how it is done on iOS too from iOS 7/8. You don't need a Developer Account anymore to put your own apps on your own phone. You need a Dev. Account only if you want to push the app on App Store.
For typical iOS development using Swift/Objective-C yes, you will need an Apple machine. Some people are using VMs instead but the experience is (usually) terrible. There are also cloud services where you can rent a macOS VPS, I never tried this approach.