#Swift 4, 5862 bytes
var n=Int(readLine()!)!;print(1<n&&(2..<n).filter{n%$0<1}==[])
Try it here! (now this service has been deprecated; the code is slightly modified in order to work there too, temporarily at least)
Note that this can only be ran from the command line, due to readLine(), the only way of taking input in Swift without a function.