Should bundle identifiers be lowercase or camelcase?

无人久伴 提交于 2019-12-10 17:34:50

问题


Say I have an app named "Foo Bar", should the bundle identifier be com.tyilo.foobar or com.tyilo.FooBar?

What is the most normal and what does Apple do?


回答1:


You can do any but to make life simpler and prevent common mistakes it's just easier to keep it all lower case..

But it's entirely up to you what case you use?. The only gain from using lower case is what I mentioned above




回答2:


I would make it the lower case not only to make your life simpler but also because bundles are reverse domain name and URLs are case insensitive up to and including the TLD (com/org/net) and most browsers display URLs as all lowercase.

Also if you look at Apple's sample code they use all lower case.

com.example.apple-samplecode




回答3:


You can use both. Preferable is always in lower case.



来源:https://stackoverflow.com/questions/10464561/should-bundle-identifiers-be-lowercase-or-camelcase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!