admin管理员组文章数量:1403452
I’m trying to create a CustomFramework that uses PLCrashReporter and CocoaLumberjack.
If the consuming application does not embed either one of these SDKs, the framework should skip executing the code that relies on the missing SDK.
Here’s the code I’m using inside custom framework
public static func testSDKS() {
#if canImport(PLCrashReporter)
print("PLCrashReporter is available")
#endif
#if canImport(CocoaLumberjack)
print("CocoaLumberjack is available")
#endif
}
and inside sample app i am using this
SDK.testSDKS()
here is full repo of code I want to fix by adding this external frameworks via SPM approach only, but open to suggestion why it won't work with SPM approach.
本文标签: option typeiOS making optional framework with canimportStack Overflow
版权声明:本文标题:option type - iOS making optional framework with canimport - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744333013a2601053.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论