The graphics code they generate is mostly just using these CGContext APIs: https://developer.apple.com/library/ios/documentation/Graphi...
Mapping to the Swift counterparts should be straightforward.