Apple actually open sourced Swift language, and it’s available for other operating systems as well: https://www.swift.org/
Xcode is the app you need to use, if you want to submit your app to macOS or iOS App Store. You can build macOS apps with other tools, but you can’t distribute them in the App Store. There are developers who sell their apps through their own websites, or through other marketplaces, such as Steam. And while you can build iOS apps with other tools as well, it’s mostly pointless as you can’t distribute them, because iPhone doesn’t support sideloading. Jailbroken iPhones are an exemption to that.
Apple actually open sourced Swift language, and it’s available for other operating systems as well: https://www.swift.org/
Xcode is the app you need to use, if you want to submit your app to macOS or iOS App Store. You can build macOS apps with other tools, but you can’t distribute them in the App Store. There are developers who sell their apps through their own websites, or through other marketplaces, such as Steam. And while you can build iOS apps with other tools as well, it’s mostly pointless as you can’t distribute them, because iPhone doesn’t support sideloading. Jailbroken iPhones are an exemption to that.