I put an implementation of the-algorithm in pure Swift for your perusal at this URL:
https://github.com/shyamalschandra/the-algorithm-swift
Please let me know if you would like to collaborate in pure Swift for your infrastructure.
Thanks,
Shyamal
[email protected]