For iOS, Apple provides these generator filters that will generate images of bar codes, QR codes, and many other codes.
https://developer.apple.com/documentation/coreimage/cifilter/generator_filters