I was trying to convert syntax of old Swift project to new one as per few suggestion on Stack Overflow I tried converting it through Edit > Convert > To latest Synta
In my case it was due to the few swift files which has been showed grayed out in the Build Phases section. After removing those files it was successful.