How does one use namespaces in iOS objective-c code?

前端 未结 2 1804
终归单人心
终归单人心 2021-01-11 10:38

I\'m writing an iOS app, \"Best Korea\". My organization name is \"Srsly.co\". I\'m going to write re-usable \"News\" libraries that I\'ll use across my apps.

Each

2条回答
  •  余生分开走
    2021-01-11 10:52

    You're correct that Objective-C doesn't have built in support for namespaces, and the common solution is to use uppercase prefixes on each class. Note that Apple has stated that two letter prefixes are reserved for their use, so you should use three letter prefixes for your own classes. Otherwise, your suggested approach is the normal thing to do.

提交回复
热议问题