Add Swift support.

Hi,

I am using Swift in my project, so I decided port this class, it was very useful for me.

This pull request is intended to contribute with Swift developers.

Thanks.