iosswiftcocoapodstyphoon

Swift: Cannot use library from Pod file


I'm using Typhoon library for Dependency Injection Framework. I use CocoaPod for installing this library. Here is my pod file:

target "typhoon-swift-demo" do
    pod 'Typhoon'
end

target "typhoon-swift-demoTests" do

end

I have installed successfully but when I open workspace project file. I type those line of code as Typhoon sample code:

public class ApplicationAssembly: TyphoonAssembly {

}

I meet error that my application doesn't recognize TyphoonAssembly I have tried to use some lines such as:

import Typhoon // not recogize typhoon
import TyphoonAssembly // not regconize

Please tell me how to fix this problem. What should I add before I can use library. Thanks :)


Solution

  • You have to import the Pod header files using Objective-C and not Swift. So you'll be mixing the two languages if you want to use CocoaPods with Swift. Here's a great tutorial on how to accomplish this.