0

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 ?

oguz ismail
  • 1
  • 16
  • 47
  • 69
hasan
  • 23,815
  • 10
  • 63
  • 101

1 Answers1

0

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.

Bogdan
  • 101
  • 2
  • I have a swift project. and a swift Lumberjack. I don't believe that CocoaLumberjack can be imported in pct file. right? – hasan Nov 13 '16 at 16:03
  • as a work around I defind a class and a class function that do the logging. so i can call the class method without an import. classname.methodname – hasan Nov 13 '16 at 16:04
  • ya that didnt work for pch file. i used to do that in obejctve c – hasan Nov 13 '16 at 16:11