Integrate Swift framework to objective-c application

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?

Upvotes: 4

Views: 765

Answers (1)

Naeem
Naeem

Reputation: 789

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!

Upvotes: 3

Related Questions