4

I am trying to integrate swift framework with objective-c application.when i am running i am getting a crash

@objc public class EquipmentManager{

var sampleString : String = ""

@objc public init(str:String){
    self.sampleString = str
}

@objc public func returnString() ->NSString{
    return sampleString
}
}

I am trying to access this class dyld: Library not loaded: @rpath/EquipmentManager.framework/EquipmentManager Referenced from: /private/var/mobile/Containers/Bundle/Application/0A26433B-B169-48A7-A006-528D076FB8A9/ObjcTest.app/ObjcTest Reason: image not found

Has anyone integrated objective-c application with swift framework?

  • i could access swift code within the same application. My problem is that i have created a swift framework and when i try to access it, I am getting a crash. – visweswaran chidambaram Feb 27 '15 at 07:05
  • Than YOU should check this out : https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html – Naeem Feb 27 '15 at 07:09
  • Check out this also : http://stackoverflow.com/questions/26024100/dyld-library-not-loaded-rpath-libswiftcore-dylib – Naeem Feb 27 '15 at 07:12

1 Answers1

3

Try This out:

There is an "Embedded Content Contains Swift Code" flag in the Build Settings that needs to be set to YES. It is NO by default!

enter image description here

Reference: TALAA

Hope This Works!

Community
  • 1
  • 1
Naeem
  • 789
  • 1
  • 10
  • 23
  • thank you! just spent more time than I care to admit trying to figure out why a way for adding an embedded binary to an objective-c app wouldn't work even though it was working for swift apps... wish I had gotten here sooner! – pbush25 Nov 04 '18 at 16:59