Question

Lets say I'm creating an SDK for a company called "MyCompany" and its a unique company name. All the library classes are prefixed with "MC" only the main API library class "MyCompany.h" is not. Is this appropriate or should I also prefix that class too?

Was it helpful?

Solution

I think that's appropriate. To make sure, I'd download some popular SDKs, and see what they do. Like Facebook, and others like that.

Also, note that technically, your class prefixes should be at least 3 characters, unless you're Apple. Per Apple. Although, I don't think a lot of people use that guideline.

Edit: I edited this because I didn't like my first answer...

OTHER TIPS

MyCompany.h does not -- should not -- define any linkable symbols. It should only #import the rest of your framework's/library's headers.

Thus, there is no conflict because there are no actual unprefixed symbols defined; there should not be a MyCompany class, for example.

Your proposed naming scheme matches what Apple does as well as what many third-party libraries do.

I think that sounds like a reasonable way to name your library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top