Global import for Swift CocoaLumberjack

2019-09-14 21:56发布

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条回答
走好不送
2楼-- · 2019-09-14 22:10

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.

查看更多
登录 后发表回答