If you found OS versions, that's the 'system'. When it's put together with developer tools, it becomes an IDE - integrated development environment
See the Xcode wiki for details on compatible macOSs. macOS 10.4.3 is required for current Xcode 10.2.1 (current macOS is 10.14.4) - however the next, Xcode v11.x, will require macOS 10.14.5. If you get a mac that runs 10.14.4, it will run 10.14.5
If you want to get something now, with legs for the next few years, get something made in the last few years, at least. My opinion is 2016 or newer at a minimum.
Just remember to max the physical ram and get twice as much SSD/HD as you think you'll need...actually, determine that number, then double it again.
Also, be aware that creating apps isn't just about running Xcode. You'll be using editors for your content, Safari to access reference materials, etc. etc. You'll consume storage space quickly, so plan ahead. And don't forget a backup to protect your work.
As for which macs...macOS Mojave runs on the following macs:
- MacBook: Early 2015 or newer.
- MacBook Air: Mid 2012 or newer.
- MacBook Pro: Mid 2012 or newer.
- Mac Mini: Late 2012 or newer.
- iMac: Late 2012 or newer.
- iMac Pro.
- Mac Pro: Late 2013 or newer; Mid 2010 or Mid 2012 if upgraded with a recommended Metal-capable GPU.