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