add swift implementation

Signed-off-by: Andre Dublin <81dublin@gmail.com>