-
install Xcode
-
install Xcode command line tools
http://cmd.hhmr.biz/2013/09/mavericksxcode-command-line-tools.html
- setup the xcode path
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
use swift to execute the source code file
$ swift <your_source_code>.swift
or
(1) add this line at the top of the file
#!/usr/bin/swift
(2) change the file to executable
$ chmod +x <your_source_code>.swift
(3) execute the file in Terminal
$ ./<your_source_code>.swift