开发者

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

开发者 https://www.devze.com 2023-03-21 00:42 出处:网络
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

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?

开发者_JAVA百科

Thanks in advance, Rob


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

0

精彩评论

暂无评论...
验证码 换一张
取 消