I simply exported the project in *.swift extension in the same directory and then I used the terminal to enter the file directory and then with the command swiftc to compile it after which I ran it with ./file name and it worked out.
Topic:
Programming Languages
SubTopic:
Swift
Tags: