The Mac or iOS programming topics can be learned with a Mac or an iOS device. Xcode development environment is used for developing applications for the Apple devices.
Xcode is the development environment that MacOS developers use. It's a very powerful and robust tool, but it's also quite intimidating for beginners.
If you're just getting started with programming, we recommend using either Xcode or Visual Studio Code (or another IDE) to develop iOS apps.