How can I generate bitcoin cash addresses programmatically? If I'm a mobile developer who wants to integrate bitcoin cash in an app, how can I generate Bitcoin Cash addresses programmatically, without relying on a 3rd party service, like Coinbase?
You can use the following library to generate bitcoin address using Swfit on IOS

https://github.com/onmyway133/AddressGenerator

Please note that the legacy bitcoin cash and bitcoin address is the same the only difference is the network.

if you're looking for cashAddr (qq address) format, take a look on these open source libraries:

https://github.com/bitcoincashjs/cashaddrjs (javascript)
https://cashaddr.bitcoincash.org/
https://github.com/schancel/cashaddr-converter

Original cashAddr algorithm (C++)

https://github.com/Bitcoin-ABC/bitcoin-abc/blob/master/src/cashaddr.cpp

it's pretty easy to read and understand, you can translate it to any language.