Is there a place to put a category import statement so all classes see it?

时光毁灭记忆、已成空白 提交于 2019-12-12 11:13:29

问题


I have an Objective-C category of UIColor that I would like to "import" everywhere in my project. But instead of using the #import to every class that needs it I was told there was a way to set it up so all classes can see it. Anyone know how this is accomplished?

Thanks in advance, Rob


回答1:


Add that import to the precompiled header file (*.pch) in your project - that way it will be imported to any implementation file automatically.



来源:https://stackoverflow.com/questions/6707590/is-there-a-place-to-put-a-category-import-statement-so-all-classes-see-it

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