Write code on iPad, offline
the best app I ever used: Textastic. It costs about 7 USD/EUR and it is one of the most sophisticated apps I know.
I am a web and app developer and I like to use it with SFTP connection support and Dropbox combination ...

https://itunes.apple.com/us/app/textastic-code-editor-6/id1049254261?mt=8

https://www.textasticapp.com