Add support for swift

- fix build failure when files are copied manually
- add example code in swift