Search code examples
iosobjective-cconventions

Objective-C Class Prefix for a library APIs


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?


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...