Hi, everyone. I am trying to print out “Hello, world” by creating a Command Line tool project. I try to type “swiftc Hello.swift” to compile it in the terminal but instead of having a file named Hello.swift, I have a file named by default Hello.xcodeprojec. How I can solve this issue?
Hello.xcodeproject is your Xcode project file. Among lots of other things, it keeps track of where the files are for this project.
You need to create a Hello.swift file in your Xcode project.
Load the Hello.xcodeproject
file, and see if there's aHello.swift
file in the project view on the left.
If not, then you have to create one, and write your code in there.
If there is - and it's red - it means the file has been moved and Xcode doesn't know about it. If you can locate it (use Spotlight) you can put it back in the same folder as the Hello.xcodeproject
file.
How about launching the project file and taking a screenshot to show us what's in the left side project view?