Global import for Swift CocoaLumberjack

放肆的年华 提交于 2019-12-25 08:19:55

问题


I configured CocoaLumberjack properly using the swift pod.

And I can log whatever:

DDLogVervose("")
DDLogInfo("")

But I have to in every class to use it:

import CocoaLumberjack

Isnt there a way that I can globaly import ?


回答1:


The only "trick" to have it available in all your classes is to use a pch (precompiled header) and import CocoaLumberjack there. It's a header that gets imported in all your files.



来源:https://stackoverflow.com/questions/40568997/global-import-for-swift-cocoalumberjack

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