First, install Xcode 6 beta.
And run it.
sudo xcode-select -switch /Applications/Xcode6-Beta.app/Contents/Developer
By xcrun swift
, repl will start.
$ xcrun swift
Welcome to Swift! Type :help for assistance.
1> var x = 3
x: Int = 3
Write swift code.
foo.swift
func x() -> Int {
return 3
}
println("hello")
compile
$ xcrun swift foo.swift
$ ./foo
hello
It works! yey!
😫