fix swift syntax for new version

fix swift syntax for new version and add gitignore