Is there a naming convention for Xcode projects?

In java and python development I’ve always used a hyphen in project names in GitHub to separate words: java-concepts. I’m learning Swift and want to keep my examples, so in both GitHub and Xcode I named my project swift-concepts.

In Xcode, when it created the project, I now have files named swift_conceptsApp.swift and swift_conceptTests.swift

Also, an example folder that was generated is swift-conceptsTests, which I don’t like the mix of separating words by both a dash and camel case. In Java, everything within the project folder was camel case, but Xcode tries to preserve the dash, and for files makes it an underscore.

Should I just name my Swift projects using camel case such as SwiftConcepts? Is that the convention?

It is Camel Cased, sometimes even with spaces - as you can see in the Apple article examples.

Makes sense, thanks!

1 Like

Kynect@joeg ,

Use camel case for project names. This means starting with a capital letter and capitalizing each subsequent word. Avoid using hyphens or underscores in project names to prevent issues with auto-generated files and folder names. Hyphens can lead to underscores in filenames, creating an inconsistent naming scheme.
Xcode tends to use underscores to replace hyphens in file names. For consistency, stick to camel case for project names so that generated files follow a predictable pattern.
Xcode may create folders using hyphens if your project name includes them. To avoid a mix of hyphens and camel case, it’s better to use camel case from the start.
On GitHub, using hyphens is common for separating words in repository names for readability. However, this does not affect the internal structure of your Xcode project.

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.