I tried to follow the README, but it didn't make sense. Steps 1 and 2 were fine (and I could build the project with the dependency, without any code of my own), but Step 3 was completely confusing:
Add the following to the static func main() in MyGame.swift.
The swift package init --type executable command does not create a file named MyGame.swift. There's only main.swift (inside ~/Projects/MyGame/Sources). And, I cannot add the provided code "to the static func main()", as that construct doesn't exist in Swift. A static func must be a method.
Note: The main.swift file only contains print("hello world") by default. There's no class or struct or anything to add to.
It looks like a really fun project. I just couldn't follow the tutorial. :(
I tried to follow the README, but it didn't make sense. Steps 1 and 2 were fine (and I could build the project with the dependency, without any code of my own), but Step 3 was completely confusing:
The
swift package init --type executable
command does not create a file namedMyGame.swift
. There's onlymain.swift
(inside~/Projects/MyGame/Sources
). And, I cannot add the provided code "to thestatic func main()
", as that construct doesn't exist in Swift. Astatic func
must be a method.Note: The
main.swift
file only containsprint("hello world")
by default. There's no class or struct or anything to add to.It looks like a really fun project. I just couldn't follow the tutorial.
:(