Cocoapods: turning MagicalRecord logging off

前端 未结 5 1173
傲寒
傲寒 2020-12-23 09:39

Turning MagicalRecord logging off requires a #define to be made before it is first included in the project, but in the case of a project managed by Cocoapods I have no acces

5条回答
  •  时光说笑
    2020-12-23 10:17

    In my case, I was building a library that depended on MagicalRecord. I didn't want my users to have to add a post_install in their Podfile to silence the noisy logging, so I added it to my podspec instead.

      s.prefix_header_contents = '#define MR_ENABLE_ACTIVE_RECORD_LOGGING 0'
    

    This automatically adds this #define statement to Pods-prefix.pch, which silences MagicalRecord logging in projects that use my pod.

提交回复
热议问题