How can I use swift in Terminal?

后端 未结 13 612
北荒
北荒 2020-11-29 15:28

I read What\'s new in Xcode 6. The article introduces some new feature about Xcode 6, and it says:

Command Line

Xcode’s debugger includes an inter

13条回答
  •  悲哀的现实
    2020-11-29 16:10

    In Xcode 6.1.1 with Command Line Tools installed you can execute scripts by referencing directly to /usr/bin/swift the following way:

    #!/usr/bin/swift
    
    let variable: String = "string"
    print("Test \(variable)")
    

提交回复
热议问题