Reputation: 395
I have problem app crashed when i try link swift framework with objective - c project
dyld: Library not loaded: @rpath/libswiftCoreImage.dylib
Referenced from: /Users/arcilite/Library/Developer/Xcode/DerivedData/SamplesAdaptiveController-fpznutybiarsvsbwskrhgwflbcdo/Build/Products/Debug-iphonesimulator/AdaptiveController.framework/AdaptiveController
Do you have any ideas? I can use swift framework in objective - c code? Thanks
P.S Xcode 6.0 release. Simulator
Upvotes: 3
Views: 1539
Reputation: 86
I faced a similar issue while trying to call a function from a pure Swift framework in an existing Objective C app. I was using XCode 6.1 and an iOS 7.1.2 device and had tried all the other recommendations on Stack Overflow.
Create a dummy Swift file in your Objective-C project (if you don't already have any Swift file in your project). In that Swift file, just add this line to import UIKit:
import UIKit
That seems to force XCode to package the required Swift libraries in the app and stop it from crashing.
Upvotes: 7
Reputation: 202
This can occur if you're using a library but aren't using Swift elsewhere in your code. Try setting the Embedded Content Contains Swift Code
to YES
in your project's build settings. From Apple:
When building an application that does not contain Swift source files but embeds other content (like frameworks, XPC services, app extensions, and so on) that does contain Swift code, you must set the build setting Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT). That way the Swift libraries will be included in the application.
Hope this helps!
Upvotes: 2