Let’s start with a normal Podfile for a test project called ‘cocoapods-test’
platform :osx, '10.10' link_with 'cocoapods-test', 'cocoapods-testTests' pod 'RaptureXML'
As you can see, I link also the test-target in my Podfile, because I want the Pods to also be available there.
Now lets execute the beloved
But now? We have a pure Swift project here, so how to I use the Objective-C resources in my target? The solution is already mentioned in the official Swift guide:
Fill out an Objective-C bridging header if you need to access Objective-C code from the same app target in your Swift file.
We need a bridging header, which Xcode automatically creates when you want to add the first Objective-C file to a Swift project. So we just add a file called “dummy”. This file I will delete later.
Then Xcode will ask
This auto-generation will also add the corresponding path to this header file into our Build Settings.
Into this header file we can then add our wanted Objective C headers like e.g.
We can the use this library in our Swift files like e.g.
var rootXML : RXMLElement! = RXMLElement.elementFromXMLData(data) as RXMLElement