Its possible to write the code on a none-apple computer.
I do think, tho, that apple require you to build on a apple machine when building for iPhone/iPad etc.
You will also need a developer license, which I think cost ~$99/year.
Check out the apple dev page for more info!
https://developer.apple.com/