如何为终端创建二进制/脚本文件

时间:2018-01-27 22:37:14

标签: swift xcode terminal executable binaryfiles

我创建了一个小程序:



struct Person{
    let firstName: String
    let lastName: String
    func sayHello() {
        print("Part 1")
        print(firstName)
        print(lastName)
        print()
        
        print("Part 2")
        print(firstName, lastName, separator:"\n")
        print()
        
        print("Part 3")
        print(firstName, lastName)
        print()
        
        print("Part 
        print(firstName, terminator:" ")
        print(lastName)
        print()
    }
}

let aPerson = Person(firstName: "x", lastName: "z")
aPerson.sayHello()




但是,我在将此代码转换为终端时遇到了麻烦..

在终端内我想重新创建这个程序..

  1. 作为可以从终端执行的已编译的可执行二进制文件。

  2. 作为可以从终端执行的脚本文件。

  3. 我发现这篇文章: How do I build an executable for an application written in Swift from the terminal?

    虽然,我不确定如何解释那个

0 个答案:

没有答案